jalali-moment
Advanced tools
Comparing version 2.1.7 to 2.1.8
@@ -729,4 +729,2 @@ | ||
}; | ||
jMoment.fn.jYear = function (input) { | ||
@@ -752,3 +750,2 @@ var lastDay | ||
}; | ||
jMoment.fn.jMonth = function (input) { | ||
@@ -786,3 +783,2 @@ var lastDay | ||
}; | ||
jMoment.fn.jDate = function (input) { | ||
@@ -814,3 +810,2 @@ var j | ||
}; | ||
jMoment.fn.jDayOfYear = function (input) { | ||
@@ -825,3 +820,2 @@ var dayOfYear = Math.round((jMoment(this).startOf("day") - jMoment(this).startOf("jYear")) / 864e5) + 1; | ||
}; | ||
jMoment.fn.jWeek = function (input) { | ||
@@ -836,3 +830,2 @@ var week = jWeekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).week; | ||
}; | ||
jMoment.fn.jWeekYear = function (input) { | ||
@@ -930,2 +923,3 @@ var year = jWeekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; | ||
}; | ||
jMoment.fn.clone = function () { | ||
@@ -940,2 +934,7 @@ return jMoment(this); | ||
}; | ||
jMoment.fn.doAsGregorian = function () { | ||
this.isJalali = false; | ||
this.usingFaDigits = false; | ||
return this; | ||
}; | ||
@@ -951,8 +950,2 @@ /** | ||
jMoment.fn.doAsGregorian = function () { | ||
this.isJalali = false; | ||
this.usingFaDigits = false; | ||
return this; | ||
}; | ||
/** | ||
@@ -976,9 +969,2 @@ * @deprecated you could substitude with m.locale('fa') | ||
jMoment.useJalaliSystemPrimarily = function () { | ||
moment.justUseJalali = true; | ||
}; | ||
jMoment.useJalaliSystemSecondary = function () { | ||
moment.justUseJalali = false; | ||
}; | ||
jMoment.fn.jYears = jMoment.fn.jYear; | ||
@@ -1019,5 +1005,2 @@ jMoment.fn.jMonths = jMoment.fn.jMonth; | ||
}; | ||
/************************************ | ||
jMoment Statics | ||
************************************/ | ||
jMoment.fn.locale = function(locale) { | ||
@@ -1033,2 +1016,5 @@ if (moment.changeCalendarSystemByItsLocale) { | ||
}; | ||
/************************************ | ||
jMoment Statics | ||
************************************/ | ||
jMoment.locale = function(locale) { | ||
@@ -1044,6 +1030,17 @@ if (moment.changeCalendarSystemByItsLocale) { | ||
}; | ||
jMoment.changeCalendarSystemUponLocale= function () { | ||
jMoment.bindCalendarSystemAndLocale = function () { | ||
moment.changeCalendarSystemByItsLocale = true; | ||
}; | ||
jMoment.unBindCalendarSystemAndLocale = function () { | ||
moment.changeCalendarSystemByItsLocale = false; | ||
}; | ||
jMoment.useJalaliSystemPrimarily = function () { | ||
moment.justUseJalali = true; | ||
}; | ||
jMoment.useJalaliSystemSecondary = function () { | ||
moment.justUseJalali = false; | ||
}; | ||
jMoment.jDaysInMonth = function (year, month) { | ||
@@ -1050,0 +1047,0 @@ year += div(month, 12); |
{ | ||
"name": "jalali-moment", | ||
"version": "2.1.7", | ||
"version": "2.1.8", | ||
"description": "Display, parse, manipulate ,validate and convert jalali (Persian, Khorshidi, Shamsi) date and time", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -211,3 +211,5 @@ # Jalali Moment | ||
### Change calendar system on changing its locale | ||
moment.changeSystemByItsLocale(); | ||
```js | ||
moment.bindCalendarSystemAndLocale(); | ||
``` | ||
@@ -214,0 +216,0 @@ ### An example usage: |
10
test.js
@@ -389,3 +389,9 @@ | ||
it("should return Jalaali week of year", function() { | ||
var m = moment("1981-08-17"); | ||
var m = moment("1396/01/04","jYYYY/jMM/jDD"); | ||
m.format("jYY/jM/jD").should.be.equal("96/1/4"); | ||
m.jWeek().should.be.equal(1); | ||
m = moment("1396/01/05","jYYYY/jMM/jDD"); | ||
m.format("jYY/jM/jD").should.be.equal("96/1/5"); | ||
m.jWeek().should.be.equal(2); | ||
m = moment("1981-08-17"); | ||
m.jWeek().should.be.equal(22); | ||
@@ -925,3 +931,3 @@ m.jDayOfYear(1); | ||
var m1 = moment("1367/11/04","jYYYY/jMM/jDD"); | ||
moment.changeCalendarSystemUponLocale(); | ||
moment.bindCalendarSystemAndLocale(); | ||
m1.locale('fa'); | ||
@@ -928,0 +934,0 @@ m1.format('YYYY/MM/DD').should.be.equal('1367/11/04'); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
2160903
18
24709
270
4