Zayar.

Flutter MMCalendar

Myanmar calendar flutter package.

License: MIT

Pub Version (including pre-releases)

Package to get Myanmar calendar information with Burmese Astrological Information, Holidays and Moon phase widget.

You can check Myanmar Calendar App using flutter_mmcalendar.

Image Image Image Image

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:

yaml

dependencies: flutter_mmcalendar:

Install it:

sh

flutter packages get

Features

  • Myanmar Date
  • Western Date
  • Astrological Information
  • Holidays - Myanmar Thingyan holidays and other holidays.
  • MoonPhase widget.

Usage

Import package

dart

import 'package:flutter_mmcalendar/flutter_mmcalendar.dart';

Sample Usage:

dart

// 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, ), );

And use it

dart

// Get MyanmarDate by year, month and day final myanmarDate = mmCalendar.fromDate(2023, 10, 19);

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:

dart

// 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

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):

dart

// 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
LetterDate ComponentExamples MyanmarExamples English
SSasana yearแ€žแ€ฌแ€žแ€”แ€ฌแ€”แ€พแ€…แ€บSasana Year
sBuddhist eraแ‚แ…แ†แ2561
BBurmese yearแ€™แ€ผแ€”แ€บแ€™แ€ฌแ€”แ€พแ€…แ€บMyanmar Year
yMyanmar yearแแƒแ‡แ‰1379
kKuแ€แ€ฏ
MMonth in yearแ€แ€ซแ€แ€ฑแ€ซแ€„แ€บWagaung
pMoon phaseแ€œแ€†แ€”แ€บแ€ธwaxing
fFortnight Dayแ1
rYatแ€›แ€€แ€บ
EDay name in weekแ€แ€”แ€„แ€บแ€นแ€œแ€ฌMonday
nNayแ€”แ€ฑแ€ท

Astrological Information

dart

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();

You can also check these days by calling is prefix properties.

Example:

dart

// It will return true or false final isAmyeittasote = astro.isAmyeittasote;

Moon Phase Widget

dart

MoonPhaseWidget( date: DateTime.now(), size: 50, ),

Concept reference resources

Algorithm, Program and Calculation of Myanmar Calendar

C++ and Javascript Implementation

Java Library Implementation

  • #dart,
  • #flutter,
  • #package,
  • #mmcalendar,
  • #calendar,
  • #utilities