Skip to content

phothinmg/burmese-calendar

Repository files navigation

pk

Burmese Calendar(Myanmar Calendar)

GitHub License GitHub Actions Workflow Status GitHub Actions Workflow Status NPM Version

Overview

Gregorian calendar to some Burmese calendar information.

This project is still in progress and is only for my Burmese calendar and astronomy studies.

Please note that it is not guaranteed for use in production.

Demo Calendar : https://phothinmg.github.io/demo-bcal/


Resources

Burmese Calendar

Julian Date and Moon Phases


Node Js

Api docs : https://www.jsdocs.io/package/burmese-calendar

Install

npm i burmese-calendar
yarn add burmese-calendar
pnpm add burmese-calendar

Example Usage for Node js

import { BurmeseCal } from "burmese-calendar"; // esm

const { BurmeseCal } = require("burmese-calendar"); //common js

const bcal = new BurmeseCal();

// Date Time to jd and jdn
const julian = bcal.datetimeToJd({ year: 2025, month: 3, day: 6 ,hour:23,minutes:25,seconds:22}); // { jd: 2460741.475949074, jdn: 2460741 }

// Jd , JDN to Date Time
const dt = bcal.jdToDatetime( 2460741.475949074); //{ year: 2025, month: 3, day: 6, hour: 23, minutes: 25, seconds: 22 }
const dt2 = bcal.jdToDatetime(2460741); //{ year: 2025, month: 3, day: 6, hour: 12, minutes: 0, seconds: 0 }

// gregorian calendar date to julian calendar date
const toj = bcal.calendarConverter({
  ct: "julian",
  year: 2025,
  month: 3,
  day: 6,
}); // { year: 2025, month: 2, day: 21 }
// julian calendar date to gregorian calendar date
const tog = bcal.calendarConverter({
  ct: "gregorian",
  year: 2025,
  month: 3,
  day: 6,
}); // { year: 2025, month: 3, day: 19 }

// getting calendar views
const dv = bcal.dayView({ year: 2025, month: 3, day: 6 });
const mv = bcal.monthView({ year: 2025, month: 3 });
const yv = bcal.yearView({ year: 2025 });

Browser

jsDelivr : https://www.jsdelivr.com/package/npm/burmese-calendar

<script src="https://cdn.jsdelivr.net/npm/burmese-calendar/cdn/index.min.js"></script>

C++

bcal.hpp and its dependencies in thetkarit folder , visit here and download thetkarit.zip.

Run example in Linux

Clone git repository , build it using cmake, and run it as follows:

$ git clone https://github.com/phothinmg/burmese-calendar.git
$ cd burmese-calendar
$ mkdir build
$ cd build
$ cmake ..
$ make
$ ./bcal