Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

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: 'گاهنبار پَتیَه‌شَهیم، جشن پایان تابستان' } ]
```