Last updated:
0 purchases
flutter mmcalendar
Flutter MMCalendar #
Package to get Myanmar calendar information with Burmese Astrological Information, Holidays and Moon phase widget.
You can check Myanmar Calendar App using flutter_mmcalendar.
Installation ๐ป #
โ In order to start using flutter_mmcalendar you must have the Flutter SDK installed on your machine.
Add flutter_mmcalendar to your pubspec.yaml:
dependencies:
flutter_mmcalendar:
copied to clipboard
Install it:
flutter packages get
copied to clipboard
Features #
Myanmar Date
Western Date
Astrological Information
Holidays - Myanmar Thingyan holidays and other holidays.
MoonPhase widget.
Usage #
Import package
import 'package:flutter_mmcalendar/flutter_mmcalendar.dart';
copied to clipboard
Sample Usage:
// Default
final mmCalendar = MmCalendar(
config: MmCalendarConfig.defaultConfig(),
);
// English language config
final mmCalendar = MmCalendar(
config: MmCalendarConfig.englishLanguage(),
);
// Specific language and calendar type
final mmCalendar = MmCalendar(
config: const MmCalendarConfig(
calendarType: CalendarType.gregorian,
language: Language.myanmar,
),
);
copied to clipboard
And use it
// Get MyanmarDate by year, month and day
final myanmarDate = mmCalendar.fromDate(2023, 10, 19);
copied to clipboard
Available configs:
MmCalendarConfig.defaultConfig()
MmCalendarConfig.myanmarLanguage()
MmCalendarConfig.zawgyiLanguage()
MmCalendarConfig.englishLanguage()
MmCalendarConfig.monLanguage()
MmCalendarConfig.karenLanguage()
MmCalendarConfig.taiLanguage()
Available languages:
english
myanmar - myanmar unicode
zawgyi - myanmar zawgyi
mon
karen
tai
Other usages:
// Date conversion methods.
final myanmarDate = mmCalendar.fromDateTime(DateTime.now());
mmCalendar.fromDate(2023, 7, 27);
mmCalendar.fromDateAndTime(2023, 7, 27, 10, 30, 01);
mmCalendar.fromJulian(2456599);
final westernDate = mmCalendar.getWesternDateFromJulianDay(2456599);
/// Astrological information
final astro = myanmarDate.astro;
final astroByLanguage = myanmarDate.getAstro(
languageCatalog: LanguageCatalog.myanmar(),
);
astro.getMahabote();
// All Holidays
List<String> holidays = myanmarDate.holidays;
final resultStr = myanmarDate.formatByPatternAndLanguage(
pattern: MyanmarDateFormat.simple,
langCatalog: mmCalendar.languageCatalog,
);
// Output: แแฌแแแฌแแพแ
แบ แแ
แแ แแฏ, แแผแแบแแฌแแพแ
แบ แแแแ
แแฏ, แแฎแแแบแธแแปแฝแแบ แแแผแแบแท แแแบ แแแแบแนแแแฝแฑแแฑแท
// (or)
final resultStr = myanmarDate.formatByPatternAndLanguage(
pattern: 'S s k, B y k, M p f r En',
langCatalog: LanguageCatalog(language: Language.english),
);
// Output: Sasana Year 2567 , Myanmar Year 1385 , Thadingyut full moon Sunday
copied to clipboard
Myanmar Date Patterns
Myanmar Date formats are specified by date pattern strings.
The following pattern letters are defined ('S', 's', 'B', 'y', 'k', 'M', 'p', 'f', 'E', 'n', 'r', are reserved):
// S s k, B y k, M p f r En
MyanmarDateFormat.simple
// S
MyanmarDateFormat.sasanaYear
// s
MyanmarDateFormat.buddhistEra
// B
MyanmarDateFormat.burmeseYear
// y
MyanmarDateFormat.myanmarYear
// k
MyanmarDateFormat.ku
// M
MyanmarDateFormat.monthInYear
// p
MyanmarDateFormat.moonPhase
// f
MyanmarDateFormat.fortnightDay
// E
MyanmarDateFormat.dayNameInWeek
// n
MyanmarDateFormat.nay
// r
MyanmarDateFormat.yat
copied to clipboard
Letter
Date Component
Examples Myanmar
Examples English
S
Sasana year
แแฌแแแฌแแพแ
แบ
Sasana Year
s
Buddhist era
แแ
แแ
2561
B
Burmese year
แแผแแบแแฌแแพแ
แบ
Myanmar Year
y
Myanmar year
แแแแ
1379
k
Ku
แแฏ
M
Month in year
แแซแแฑแซแแบ
Wagaung
p
Moon phase
แแแแบแธ
waxing
f
Fortnight Day
แ
1
r
Yat
แแแบ
E
Day name in week
แแแแบแนแแฌ
Monday
n
Nay
แแฑแท
Astrological Information #
final mmCalendar = MmCalendar(
config: MmCalendarConfig.myanmarLanguage(),
);
final myanmarDate = mmCalendar.fromDate(2023, 10, 19);
final astro = myanmarDate.astro;
// แกแแผแญแแนแแ
แฏแแบ
final amyeittasote = astro.getAmyeittasote();
// แแแบแแฌแแฌ, แแผแฟแแซแธ, แแฝแแบแธแแฝแฒแแผแฟแแซแธ
final astrologicalDay = astro.getAstrologicalDay();
// "Binga", "Atun", "Yaza", "Adipati", "Marana", "Thike", "Puti"
final mahabote = astro.getMahabote();
// แแแฌแแแบแแผแแบแธ
final mahayatkyan = astro.getMahayatkyan();
// "West", "North", "East", "South"
final nagahle = astro.getNagahle();
// แแแซแธแแฑแซแบ
final nagapor = astro.getNagapor();
// "Ogre", "Elf", "Human"
final nakhat = astro.getNakhat();
// แฅแแฏแแบ
final sabbath = astro.getSabbath();
// แแพแแบแธแแแบ
final shanyat = astro.getShanyat();
// แแแฌแธแแญแฏ
final thamanyo = astro.getThamanyo();
// แแแฌแธแแผแฐ
final thamaphyu = astro.getThamaphyu();
// แแซแแแญแแนแแฏแแผแฎแธ
final warameittugyi = astro.getWarameittugyi();
// แแซแแแญแแนแแฏแแแบ
final warameittunge = astro.getWarameittunge();
// แแแบแแฏแแบ
final yatpote = astro.getYatpote();
// แแแบแแฏแแบแแฌ
final yatyotema = astro.getYatyotema();
// "แแฏแฟแแพแ
แบ", "แแฌแแแพแ
แบ", "แแนแแแญแฏแแบแแถแแ
แนแแญแฏแแบแแแพแ
แบ", "แ
แแบแแพแ
แบ", "แแญแแปแแบแแพแ
แบ", "แ
แญแฟแแพแ
แบ", "แกแฌแแแบแแพแ
แบ", "แแแแแบแแพแ
แบ",
// "แแแนแแผแแถแแ
แนแแฏแถแแบแแพแ
แบ", "แกแฌแแญแแบแแพแ
แบ", "แแผแแญแฏแแบแแพแ
แบ", "แแผแญแแนแแแญแฏแแบแแพแ
แบ"
final yearName = astro.getYearName();
copied to clipboard
You can also check these days by calling is prefix properties.
Example:
// It will return true or false
final isAmyeittasote = astro.isAmyeittasote;
copied to clipboard
Moon Phase Widget #
MoonPhaseWidget(
date: DateTime.now(),
size: 50,
),
copied to clipboard
Concept reference resources #
Algorithm, Program and Calculation of Myanmar Calendar
https://cool-emerald.blogspot.com/2013/06/algorithm-program-and-calculation-of.html (Dr Yan Naing Aye)
C++ and Javascript Implementation
https://github.com/yan9a/mmcal
Java Library Implementation
https://github.com/chanmratekoko/mmcalendar
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.