flutter_khmer_chankitec 0.0.3 copy "flutter_khmer_chankitec: ^0.0.3" to clipboard
flutter_khmer_chankitec: ^0.0.3 copied to clipboard

A Flutter plugin for Khmer lunar calendar (Chhankitek/ចន្ទគតិ) calculations. Convert Gregorian dates to Khmer lunar dates with full support for Buddhist calendar features including Sila days detection.

flutter_khmer_chankitec #

A Flutter plugin for Khmer lunar calendar (Chhankitek/ចន្ទគតិ) calculations and date conversions.

pub package


💝 Support This Project #

Donate via KHQR
Scan to donate via KHQR (ស្កេនដើម្បីបរិច្ចាគតាម KHQR)

Features #

  • ✅ Convert Gregorian to Khmer lunar dates
  • ✅ Detect Sila days (ថ្ងៃសីល), full moon, and new moon
  • ✅ Complete Khmer date formatting
  • ✅ Pure Dart - works on all platforms

Installation #

dependencies:
  flutter_khmer_chankitec: ^0.0.1

Usage #

import 'package:flutter_khmer_chankitec/flutter_khmer_chankitec.dart';

// Get current Khmer lunar date
final lunarDate = Chhankitek.now();
print(lunarDate.toString());
// Output: ថ្ងៃអាទិត្យ ១កើត ខែមិគសិរ ឆ្នាំរោង ត្រីស័ក ពុទ្ធសករាជ ២៥៦៧
//         ត្រូវនឹងថ្ងៃទី០៤ ខែមករា ឆ្នាំ២០២៦

// Convert specific date
final date = Chhankitek.fromDate(DateTime(2024, 1, 1));

// Alternative method (same as fromDate)
final dateAlt = Chhankitek.get(DateTime(2024, 1, 1));

// Check special days
if (lunarDate.isSilaDay) print('Today is Sila day! 🙏');
if (lunarDate.isFullMoon) print('Full moon! 🌕');
if (lunarDate.isNewMoon) print('New moon! 🌑');

// Access individual properties
print('Day of Week: ${lunarDate.dayOfWeek}'); // អាទិត្យ, ច័ន្ទ, ...
print('Lunar Day: ${lunarDate.lunarDay}'); // ១កើត, ១៥កើត, ១រោច, ...
print('Lunar Month: ${lunarDate.lunarMonth}'); // មិគសិរ, បុស្ស, ...
print('Lunar Zodiac: ${lunarDate.lunarZodiac}'); // ជូត, ឆ្លូវ, ខាល, ...
print('Lunar Era: ${lunarDate.lunarEra}'); // ត្រីស័ក, ចត្វាស័ក, ...
print('Lunar Year: ${lunarDate.lunarYear}'); // ២៥៦៧
print('Solar Day: ${lunarDate.solarDay}'); // ០៤
print('Solar Month: ${lunarDate.solarMonth}'); // មករា, កុម្ភៈ, ...
print('Solar Year: ${lunarDate.solarYear}'); // ២០២៦

// Convert numbers to Khmer numerals
String khmerNum = KhmerNumberUtils.toKhmerNumber(2024); // ២០២៤
String khmerNum2 = KhmerNumberUtils.toKhmerNumber(12345); // ១២៣៤៥

// Get day of week in Khmer
String dayOfWeek = KhmerNumberUtils.getDayOfWeekInKhmer(DateTime.now());
// អាទិត្យ, ច័ន្ទ, អង្គារ, etc.

// Get solar month in Khmer
String monthKh = KhmerNumberUtils.getSolarMonthKh(1); // មករា (January)
String monthKh2 = KhmerNumberUtils.getSolarMonthKh(12); // ធ្នូ (December)

API #

Main Methods #

  • Chhankitek.now() - Get current Khmer lunar date
  • Chhankitek.fromDate(DateTime) - Convert Gregorian to lunar date
  • Chhankitek.get(DateTime) - Alternative method (same as fromDate)

KhmerLunarDate Properties #

  • dayOfWeek - Day of week in Khmer (អាទិត្យ, ច័ន្ទ, អង្គារ, ពុធ, ព្រហស្បតិ៍, សុក្រ, សៅរ៍)
  • lunarDay - Lunar day with phase (e.g., ១កើត, ១៥រោច)
  • lunarMonth - Lunar month name (មិគសិរ, បុស្ស, មាឃ, ផល្គុន, ចេត្រ, ពិសាខ, ជេស្ឋ, អាសាឍ, ស្រាពណ៍, ភទ្របទ, អស្សុជ, កក្ដិក)
  • lunarZodiac - Zodiac animal (ជូត, ឆ្លូវ, ខាល, ថោះ, រោង, ម្សាញ់, មមីរ, មមែ, វក, រកា, ច, កុរ)
  • lunarEra - Era name (សំរឹទ្ធិស័ក, ឯកស័ក, ទោស័ក, ត្រីស័ក, ចត្វាស័ក, បញ្ចស័ក, ឆស័ក, សប្តស័ក, អដ្ឋស័ក, នព្វស័ក)
  • lunarYear - Buddhist Era year in Khmer numerals
  • solarDay - Solar day in Khmer numerals
  • solarMonth - Solar month in Khmer (មករា, កុម្ភៈ, មីនា, មេសា, ឧសភា, មិថុនា, កក្កដា, សីហា, កញ្ញា, តុលា, វិច្ឆកា, ធ្នូ)
  • solarYear - Solar year in Khmer numerals
  • isSilaDay - Check if it's a Sila day (ថ្ងៃសីល)
  • isFullMoon - Check if it's full moon (ថ្ងៃពេញបូណ៌មី)
  • isNewMoon - Check if it's new moon (ថ្ងៃបាតមាស)
  • toString() - Get full formatted date string

KhmerNumberUtils Methods #

  • KhmerNumberUtils.toKhmerNumber(int) - Convert integer to Khmer numerals (e.g., 2024 → ២០២៤)
  • KhmerNumberUtils.getDayOfWeekInKhmer(DateTime) - Get day of week in Khmer
  • KhmerNumberUtils.getSolarMonthKh(int) - Get solar month name in Khmer (1-12)

Constants Available #

Access Khmer constants through KhmerConstants:

  • KhmerConstants.khmerNumerals - Map of digits to Khmer numerals (០១២៣៤៥៦៧៨៩)
  • KhmerConstants.daysOfWeek - Days of week in Khmer
  • KhmerConstants.lunarMonths - List of lunar month names
  • KhmerConstants.solarMonthsKh - List of solar month names in Khmer
  • KhmerConstants.animalYears - List of zodiac animal names
  • KhmerConstants.eraYears - List of era names
  • KhmerConstants.moonStatusKh - Moon status (កើត/រោច)

Example #

Run the example app:

cd example
flutter run

Contributing #

Contributions welcome! Please submit a Pull Request.

License #

MIT License - Copyright (c) 2026 Veng Ann

1
likes
0
points
432
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for Khmer lunar calendar (Chhankitek/ចន្ទគតិ) calculations. Convert Gregorian dates to Khmer lunar dates with full support for Buddhist calendar features including Sila days detection.

Repository (GitHub)
View/report issues

Topics

#khmer #calendar #lunar-calendar #buddhist-calendar #cambodia

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_khmer_chankitec