flutter_khmer_chankitec 0.0.2
flutter_khmer_chankitec: ^0.0.2 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.
💝 Support This Project #
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));
// Check special days
if (lunarDate.isSilaDay) print('Today is Sila day! 🙏');
if (lunarDate.isFullMoon) print('Full moon! 🌕');
API #
Main Methods #
Chhankitek.now()- Get current Khmer lunar dateChhankitek.fromDate(DateTime)- Convert Gregorian to lunar date
Properties #
dayOfWeek- Day of week (អាទិត្យ, ច័ន្ទ, ...)lunarDay- Lunar day with phase (កើត/រោច)lunarMonth- Lunar month namelunarZodiac- Zodiac animal (ជូត, ឆ្លូវ, ...)lunarEra- Era name (សំរឹទ្ធិស័ក, ឯកស័ក, ...)lunarYear- Buddhist Era yearisSilaDay,isFullMoon,isNewMoon- Special day checks
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