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: فارسی
[![MIT License][license-image]][license-url]
[![Build Status][travis-image]][travis-url]
[![NPM version][npm-version-image]][npm-url]
[![Package Quality][packageQuality-image]][packageQuality-url]
[![dependencies Quality][dependencies-quality]][dependencies-quality-url]
[![dev dependencies Quality][dev-dependencies-quality]][dev-dependencies-quality-url]
[![Codacy Badge][codacy-quality]][codacy-quality-url]
[![Codacy Badge][codacy-coverage]][codacy-coverage-url]
Table Of Content
-
Install
-
Use jalali moment in
-
Use API
This plugin provides 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
Usage
- 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.isSame(m1.clone());
- Convert
moment('1367/11/04', 'YYYY/MM/DD').locale('en').format('YYYY/MM/DD');
moment.locale('en');
moment('1989/01/24').locale('fa').format('YYYY/MM/DD');