Jalali Moment
Display, parse, manipulate and validate jalali (Persian, Khorshidi, Shamsi) or Gregorian (Miladi) dates and times and also
convert Jalali (Persian, Khorshidi, Shamsi) date to Gregorian (Miladi) or vice versa in javascript or typescript.DEMO
Read this in other languages: فارسی
How to use
-
Install
-
How to use jalali moment in
-
API
This plugin provide using jalali and gregorian calendar system together
on momentjs api.
.locale('fa');
it will use jalali calendar system
.locale('any other locale');
it will use gregorian calendar system
- Parse
moment.locale('fa');
var m1 = moment("1367/11/04","YYYY/MM/DD");
- Display
m1.format("YYYY/MM/DD");
- Manipulate
m1.add(1, "day").format("YYYY/MM/DD");
- Validate
m1.isValid();
- jalali to Gregorian
moment('1367/11/04', 'YYYY/MM/DD').locale('en').format('YYYY/MM/DD');
- Gregorian to jalali
moment.locale('en');
moment('1989/01/24').locale('fa').format('YYYY/MM/DD');