ara-persian-cal
v1.1.1
Published
> This library is generated to converting Jalali/Gregorian dates as easy as possible
Downloads
5
Readme
AraPersianCal
This library is generated to converting Jalali/Gregorian dates as easy as possible
installation
Run
npm install ara-persian-cal
usage
Angular
import { DateFormat, ToPersian } from 'ara-persian-cal';
pattern:DateFormat;
/*
1. 'YYYY/MM/DD' => 1368/05/15;
2. 'YYYY/MM/DD hh:mm:ss' => 1368/05/15 10:20:30pm;
3. 'YYYY/MM/DD HH:mm:ss' => 1368/05/15 22:20:30;
4. 'YYYY/MM/DD hh:mm' => 1368/05/15 10:20pm;
5. 'YYYY/MM/DD HH:mm' => 1368/05/15 22:20;
*/
ToPersian(value, pattern);
Node.js
const pCal = require('ara-persian-cal');
pattern ='YYYY/MM/DD';
/*
1. 'YYYY/MM/DD' => 1368/05/15;
2. 'YYYY/MM/DD hh:mm:ss' => 1368/05/15 10:20:30pm;
3. 'YYYY/MM/DD HH:mm:ss' => 1368/05/15 22:20:30;
4. 'YYYY/MM/DD hh:mm' => 1368/05/15 10:20pm;
5. 'YYYY/MM/DD HH:mm' => 1368/05/15 22:20;
*/
pCal.ToPersian(date, pattern);