npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@itc-smis/chhankitek

v1.0.1

Published

Convert AD (Gregorian) dates to Khmer lunar (Chhankitek) dates, and compute Khmer New Year moments.

Readme

ចន្ទគតិ[Chhankitek]

Convert AD (Gregorian) dates to Khmer lunar (Chhankitek) dates, and compute the exact Khmer New Year (Moha Sangkranta) moment. Learn more about the calendar.

Zero dependencies. TypeScript. Works in Node.js (ESM & CommonJS) and the browser.

Installation

npm install @itc-smis/chhankitek

Usage

import { toLunarDate } from '@itc-smis/chhankitek';

const lunar = toLunarDate(new Date(2021, 5, 28));
lunar.toString();
// ថ្ងៃច័ន្ទ ៤ រោច ខែបឋមាសាឍ ឆ្នាំឆ្លូវ ត្រីស័ក ព.ស. ២៥៦៥

You can also pass a plain object — recommended on servers whose local timezone is not Asia/Phnom_Penh, since a Date is read using its local calendar date:

toLunarDate({ year: 2021, month: 6, day: 28 }); // month is 1-12
toLunarDate(); // defaults to today

Available fields

const lunar = toLunarDate(new Date());

lunar.dayOfWeek;   // អាទិត្យ, ច័ន្ទ, ...
lunar.lunarDay;    // ១ កើត, ២ កើត, ..., ៤ រោច
lunar.lunarMonth;  // មិគសិរ, បុស្ស, ..., បឋមាសាឍ
lunar.lunarZodiac; // ជូត, ឆ្លូវ, ...
lunar.lunarEra;    // សំរឹទ្ធិស័ក, ឯកស័ក, ..., ត្រីស័ក
lunar.lunarYear;   // ២៥៦៥, ២៥៦៦, ... (Buddhist Era, Khmer numerals)

Raw numeric values are available under attributes for programmatic use:

lunar.attributes;
// {
//   dayOfWeek: 1,          // 0 = Sunday, matches Date#getDay()
//   lunarDayCount: 4,      // 1-15
//   moonStatus: 1,         // 0 = កើត (waxing), 1 = រោច (waning)
//   lunarMonth: 12,        // index into lunarMonthNames
//   beYear: 2565,          // ពុទ្ធសករាជ
//   jolakSakarajYear: 1383,// ចុល្លសករាជ
//   mohaSakarajYear: 1944, // មហាសករាជ
//   animalYear: 1,         // 0 = ជូត
//   eraYear: 3,            // 0 = សំរឹទ្ធិស័ក
// }

Khmer New Year

import { khmerNewYearDateTime } from '@itc-smis/chhankitek';

khmerNewYearDateTime(2024);
// { year: 2024, month: 4, day: 13, hour: 22, minute: 24 }

The result is wall-clock time in Cambodia (ICT). The traditional Soriyatra algorithm resolves time in libda steps (24 minutes), so the minute can differ slightly from officially published astronomical times; the date is exact.

Other helpers

import {
  toKhmerNumber,       // 2565 -> ២៥៦៥
  visakhaBocheaJdnOf,  // Julian Day Number of Visakha Bochea day
  isKhmerLeapMonth,    // អធិកមាស — 13-month year (384 days)
  isKhmerLeapDay,      // អធិកវារៈ — year with extra day in ជេស្ឋ (355 days)
  lunarMonthNames, dayOfWeekNames, animalYearNames, eraYearNames,
} from '@itc-smis/chhankitek';