An NPM package for getting javanese weton from a gregorian date. This package can handle conversions between year 1900 AD until 2100 AD date.
# Installing the Package
$ npm install javanese-weton
# ... or using yarn ...
$ yarn add javanese-weton
We will get the weton of Dec, 21st 2012. Which the day placed on Wage Friday. So, the usage can be formed like this:
import { getWeton } from 'javanese-weton'
// Set the gregorian date ...
let gregorianDate = new Date(2012, 11, 21)
// ... then, get the weton.
console.log(getWeton(gregorianDate))
The code was typed on Usage Section's output will formed as JSON, like this:
{
"date": "Dec, 21 2012",
"wetonName": {
"saptawara": "Friday",
"pancawara": "Wage"
},
"wetonNumber": {
"saptawara": 6,
"pancawara": 3
}
}
The saptawara are forming weekly day from Sunday as 1st day until Saturday as 7th day.
- Sunday;
- Monday;
- Tuesday;
- Wednesday;
- Thursday;
- Friday;
- Saturday (numbered as 0).
The pancawara are forming Javanese pancawara day from Pahing as 1st day until Legi as 5st day.
- Pahing;
- Pon;
- Wage;
- Kliwon;
- Legi (numbered as 0).