jalali-moment
Advanced tools
Comparing version 1.2.4 to 1.2.5
@@ -667,3 +667,3 @@ declare function moment(inp?: moment.MomentInput, format?: moment.MomentFormatSpecification, strict?: boolean): moment.Moment; | ||
export function jIsLeapYear(): boolean; | ||
export function loadPersian(convertNumbersToPersian: boolean): void; | ||
export function loadPersian(convertNumbersToPersian?: boolean): void; | ||
export function unloadPersian(): void; | ||
@@ -670,0 +670,0 @@ export var jConvert: any; |
{ | ||
"name": "jalali-moment", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "Jalali (Persian, Khorshidi, Shamsi) calendar system to use in javascript or typescript.", | ||
@@ -39,7 +39,7 @@ "author": { | ||
"devDependencies": { | ||
"chai": "^2.3.0", | ||
"chai": "^4.0.2", | ||
"codacy-coverage": "^2.0.2", | ||
"eslint": "^3.19.0", | ||
"eslint": "^4.0.0", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^2.5.3", | ||
"mocha": "^3.4.2", | ||
"mocha-lcov-reporter": "^1.3.0", | ||
@@ -46,0 +46,0 @@ "path": "^0.12.7", |
@@ -96,10 +96,7 @@ # jalali-moment | ||
This plugin tries to mimic `momentjs` api. Basically, when you want to format or parse a string, just add a `j` to the format token like 'jYYYY' or 'jM'. For example: | ||
This plugin tries to mimic [moment.js](https://momentjs.com/) api. Basically, when you want to format or parse a string, just add a `j` to the format token like 'jYYYY' or 'jM'. For example: | ||
```js | ||
const m = moment('1367/11/4', 'jYYYY/jM/jD'); | ||
m = moment('1367/11/4', 'jYYYY/jM/jD'); | ||
m.format('jYYYY/jM/jD [is] YYYY/M/D'); // 1367/11/4 is 1989/1/24 | ||
m.jYear(); // 1367 | ||
m.jMonth(); // 10 | ||
m.jDate(); // 4 | ||
m.jDayOfYear(); // 310 | ||
@@ -109,2 +106,12 @@ m.jWeek(); // 45 | ||
moment.jIsLeapYear(m.jYear()); // false | ||
m.jYear(1368); // set jalali year | ||
m.jMonth(); // 10 | ||
// jMonth Accepts numbers from 0 to 11. If the range is exceeded, it will bubble up to the year. | ||
m.jMonth(3); // set a jalali month | ||
m.jDate(10); // set a date | ||
m.format("jYYYY/jMM/jD"); // 1368/4/10 | ||
m.subtract(1, "jyear"); // add a Jalali Year | ||
m.format("jYYYY/jMM/jD"); // 1367/4/10 | ||
m.add(2, "jmonth"); // add Jalali Month | ||
m.format("jYYYY/jMM/jD"); // 1367/6/10 | ||
@@ -122,2 +129,4 @@ moment('1392/6/3 16:40', 'jYYYY/jM/jD HH:mm') | ||
for more information about api you could read [moment.js](https://momentjs.com/docs/). | ||
#### Load Persian | ||
@@ -124,0 +133,0 @@ To add Persian language, use loadPersian method: |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1538899
174