A Jalali to Gregorian and Gregorian to Jalali converter with no dependency
npm install shamsiA Jalali to Gregorian and Gregorian to Jalali converter with no dependency!



- Install
- Use Shamsi in:
- Node.js
- React
- Es5
- Jquery
- Using Date
- 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]
Convert jalali to gregorian
`js`
shamsi.jalaliToGregorian(1367, 11, 4); //[1989, 1, 24]
Install via npm
`shell`
npm install shamsi -S
Install via yarn
`shell`
yarn add shamsi
Install it via npm or yarn then use it as the following code
`js`
var shamsi = require("shamsi");
shamsi.gregorianToJalali(1989, 1, 24);
#### 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';
...
render() {
return (
}
`
#### Jquery
get library using bower, npm, cdn, or cloning the repository
`HTML
`
If you want to pass date as input like:
`js
var date1 = new Date("December 17, 1995 03:24:00");
// OR
var date2 = new Date("1995-12-17T03:24:00");
// OR sth else
gregorianToJalali(date1);
`
you have to use shamsi-date-converter
#### 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