Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shkarimpour/pholiday
a persian calendar holidays library for javascript
https://github.com/shkarimpour/pholiday
calendar events hijri holiday iran jalaali javascript moment nodejs persian rasmi tatil webpack
Last synced: 3 months ago
JSON representation
a persian calendar holidays library for javascript
- Host: GitHub
- URL: https://github.com/shkarimpour/pholiday
- Owner: shkarimpour
- License: mit
- Created: 2017-03-27T13:57:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-18T12:57:56.000Z (about 4 years ago)
- Last Synced: 2024-07-27T22:27:04.374Z (4 months ago)
- Topics: calendar, events, hijri, holiday, iran, jalaali, javascript, moment, nodejs, persian, rasmi, tatil, webpack
- Language: JavaScript
- Size: 14.6 KB
- Stars: 43
- Watchers: 5
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-persian - pholiday - Persian calendar holidays library for javascript. (JavaScript)
README
# pholiday
A persian calendar holidays library for **javascript** based on [**moment-jalaali**](https://github.com/jalaali/moment-jalaali).# Online demo and Working api
[pholiday api](https://pholiday.herokuapp.com/)# installation
You can use this library in envs like nodejs, webpack and browserify.
```
$ npm install pholiday
```Library is based on **moment-jalaali** so it has all methods [**moment**](https://momentjs.com/) and [**moment-jalaali**](https://github.com/jalaali/moment-jalaali) has.
# library specific methods
## .isHoliday()
Check the selected date is holiday in Iran or not.
```
const pholiday = require('pholiday')
pholiday().isHoliday()
pholiday('1391/12/29', 'jYYYY/jMM/jDD').isHoliday() -> true
pholiday('2013-8-25 16:40:00', 'YYYY-M-D HH:mm:ss').endOf('jMonth').isHoliday() -> false
```## .events()
Get the selected dates events in Iran calendar.
```
const pholiday = require('pholiday')
pholiday().events()
pholiday('2013-8-25 16:40:00', 'YYYY-M-D HH:mm:ss').endOf('jMonth').events()
-> [ { isHoliday: false,
event: 'گاهنبار پَتیَهشَهیم، جشن پایان تابستان' } ]
```