A minimal Jalali to Gregorian and Gregorian to Jalali converter
npm install shamsi-date-converterA Jalali to Gregorian and Gregorian to Jalali converter with no dependency!



- Install
- Use Shamsi Date Converter in:
- Node.js
- React
- Es5
- Jquery
- Zero dependency
- Format date
This plugin convert jalali to gregorian and gregorian to jalali in the most simple way
Convert gregorian to jalali
``js`
shamsi.gregorianToJalali(1989, 1, 24); //[1367, 11, 4]
// OR
shamsi.gregorianToJalali('July 17, 1995 03:24:00'); //[1374, 4, 26]
// OR
const date = new Date('July 17, 1995 03:24:00');
shamsi.gregorianToJalali(date); //[1374, 4, 26]
Convert jalali to gregorian
`js`
shamsi.jalaliToGregorian(1367, 11, 4); //[1989, 1, 24]
Install via npm
`shell`
npm install shamsi-date-converter -S
Install via yarn
`shell`
yarn add shamsi-date-converter
Install it via npm or yarn then use it as the following code
`js`
var shamsi = require('shamsi-date-converter');
shamsi.gregorianToJalali('July 17, 1995 03:24:00'); //[1374, 4, 26]
#### ES5
get library using bower, npm, cdn, or cloning the repository
`HTML
`
#### React
` {shamsi.gregorianToJalali(1989, 1, 24).join('/')}js
import * as shamsi from 'shamsi-date-converter';
...
render() {
return (
}
`
#### Jquery
get library using bower, npm, cdn, or cloning the repository
`HTML
`
#### shamsi
If you don't need to pass date as input and you just want to pass year, month and date, you have to use shamsi
#### shamsi-formatter
If you want to pass formatted date as input or get formatted date from output like:
`js``
gregorianToJalali('1995/7/17'); // => 1374/4/26
// OR
jalaliToGregorian('1374/4/26'); // => 1995/7/17
// OR other formats as input or outputs
you have to use shamsi-formatter