flutter_khmer_chankitec 0.0.1 copy "flutter_khmer_chankitec: ^0.0.1" to clipboard
flutter_khmer_chankitec: ^0.0.1 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 clean Flutter plugin for Khmer lunar calendar (Chhankitek/ចន្ទគតិ) calculations and date conversions.

Features #

  • ✅ Convert Gregorian dates to Khmer lunar dates
  • ✅ Get Khmer lunar date information (day, month, year, zodiac, era)
  • ✅ Format dates in Khmer script
  • ✅ Detect Sila days (ថ្ងៃសីល - Buddhist observance days)
  • ✅ Check for full moon and new moon days
  • ✅ Support for Khmer number formatting
  • ✅ Pure Dart implementation - works on all platforms

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_khmer_chankitec: ^0.0.1

Then run:

flutter pub get

Usage #

Basic Usage #

import 'package:flutter_khmer_chankitec/flutter_khmer_chankitec.dart';

// Get current date in Khmer lunar calendar
final lunarDate = Chhankitek.now();

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

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

Accessing Date Components #

final lunarDate = Chhankitek.now();

// Day of week in Khmer
print(lunarDate.dayOfWeek); // អាទិត្យ, ច័ន្ទ, អង្គារ, etc.

// Lunar day information
print(lunarDate.lunarDay); // LunarDay object
print(lunarDate.shortLunarDay); // ១កើត, ៥រោច, etc.

// Lunar month
print(lunarDate.lunarMonth); // មិគសិរ, បុស្ស, មាឃ, etc.

// Zodiac animal
print(lunarDate.lunarZodiac); // ជូត, ឆ្លូវ, ខាល, etc.

// Era name
print(lunarDate.lunarEra); // សំរឹទ្ធិស័ក, ឯកស័ក, etc.

// Buddhist Era year (Khmer numerals)
print(lunarDate.lunarYear); // ២៥៦៧

// Gregorian components (Khmer numerals)
print(lunarDate.solarYear); // ២០២៦
print(lunarDate.solarMonth); // មករា, កុម្ភៈ, etc.
print(lunarDate.solarDay); // ០៤

Checking Special Days #

final lunarDate = Chhankitek.now();

// Check if it's a Sila day (Buddhist observance day)
if (lunarDate.isSilaDay) {
  print('Today is a Sila day! 🙏');
}

// Check for full moon
if (lunarDate.isFullMoon) {
  print('Full moon tonight! 🌕');
}

// Check for new moon
if (lunarDate.isNewMoon) {
  print('New moon tonight! 🌑');
}

Example App #

See the example directory for a complete Flutter app demonstrating the plugin usage.

To run the example:

cd example
flutter run

API Reference #

Chhankitek #

Main class for Khmer lunar calendar calculations.

Static Methods

  • Chhankitek.now()KhmerLunarDate

    • Get current date in Khmer lunar calendar
  • Chhankitek.fromDate(DateTime date)KhmerLunarDate

    • Convert Gregorian date to Khmer lunar date
  • Chhankitek.get(DateTime date)KhmerLunarDate

    • Alias for fromDate()

KhmerLunarDate #

Represents a complete Khmer lunar date.

Properties

  • dayOfWeek: String - Day of week in Khmer
  • lunarDay: LunarDay - Lunar day information
  • lunarMonth: String - Lunar month name
  • lunarZodiac: String - Zodiac animal year
  • lunarEra: String - Era year name
  • lunarYear: String - Buddhist Era year (Khmer numerals)
  • solarYear: String - Gregorian year (Khmer numerals)
  • solarMonth: String - Gregorian month (Khmer)
  • solarDay: String - Gregorian day (Khmer numerals)

Getters

  • isFullMoon: bool - True if full moon day
  • isNewMoon: bool - True if new moon day
  • isSilaDay: bool - True if Sila day (Buddhist observance)
  • shortLunarDay: String - Short lunar day format (e.g., "១កើត")

Methods

  • toString(): String - Full formatted Khmer date string

Contributing #

Contributions are welcome! Please feel free to submit a Pull Request.

Support the Project #

If you find this plugin helpful, consider supporting its development:

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

License #

MIT License

Copyright (c) 2026 Veng Ann

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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