flutter_khmer_chankitec 0.0.5 copy "flutter_khmer_chankitec: ^0.0.5" to clipboard
flutter_khmer_chankitec: ^0.0.5 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. Powered by the robust astronomical logic from momentkh.

pub package


💝 Support This Project #

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

Features #

  • High Precision: Uses astronomical calculations for New Year (Moha Songkran) and Era transitions.
  • Standard Compliant: Logic ported from the widely used momentkh library.
  • Comprehensive: Handles Leap Months (Athikameas) and Leap Days (Chantreathimeas).
  • Pure Dart: Zero dependencies, works on all platforms.

Installation #

dependencies:
  flutter_khmer_chankitec: ^0.0.5

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, 4, 13));

// Check special days
if (lunarDate.isSilaDay) print('Today is Sila day! 🙏');
if (lunarDate.isFullMoon) print('Full 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}'); 

API #

Main Methods #

  • Chhankitek.now() - Get current Khmer lunar date
  • Chhankitek.fromDate(DateTime) - Convert Gregorian to lunar date

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
  • solarDate: Formatting for solar date info
  • isSilaDay, isFullMoon, isNewMoon: Helper booleans

Credits #

This package implements the calculation logic from momentkh by Thyrith Sor. Full credit for the astronomical algorithms goes to the original author and contributors of that library.

License #

MIT License - Copyright (c) 2026 Veng Ann

1
likes
150
points
144
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

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_khmer_chankitec