irsyadulibad / weton
Library to calculate and output the Javanese Weton
Installs: 45
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 1
Open Issues: 0
Type:project
Requires (Dev)
- pestphp/pest: ^1.21
README
đ About Javanese Weton
Calculate and output the Javanese Weton from regular date. This package can handle conversions from January 1, 1900 onwards
đģ Installation
You may use composer to install javanese-weton into your project:
composer require irsyadulibad/weton
đŠī¸ Usage
⨠Getting Started
First, you need pass a DateTime to convert it into weton:
$date = new DateTime('2022-04-15'); $weton = new Weton($date);
Or, you can use static style instead
$date = new DateTime('2022-04-15'); $weton = Weton::from($date);
đ Docs
- Get weton's day an it's neptu value
// Weton's day name | ex: Friday $weton->day->name; // Weton's day neptu | ex: 6 $weton->day->neptu; // Both day and neptu as object // ex: name => Friday, neptu => 6 $weton->day;
- Get weton's pasaran and it's neptu value
// Weton's pasaran name | ex: Kliwon $weton->pasaran->name; // Weton's pasaran neptu | ex: 8 $weton->pasaran->neptu; // Both day and neptu as object // ex: name => Kliwon, neptu => 8 $weton->pasaran;
- Get total neptu
$weton->totalNeptu;
- Format to indonesian
You can change output to indonesian format usingtoIndonesian()
method
$weton->toIndonesian();
- Output as string
You can directly output the object as string, it will return pasaran and day name
// ex: Legi Friday echo $weton; // if indonesian, it will be `Jum'at Legi` echo $weton->toIndonesian();
đ Credits
Github: [https://github.com/irsyadulibad]
Website: [http://irsyadulibad.my.id]
Facebook: [https://facebook.com/irsyadulibad.dev]