UNPKG

ilib

Version:

iLib is a cross-engine library of internationalization (i18n) classes written in pure JS

1 lines 844 B
var MathUtils=require("./MathUtils.js"),Calendar=require("./Calendar.js"),JulianCal=function(options){this.type="julian",options&&"function"==typeof options.onLoad&&options.onLoad(this)};JulianCal.monthLengths=[31,28,31,30,31,30,31,31,30,31,30,31],JulianCal.cumMonthLengths=[0,31,59,90,120,151,181,212,243,273,304,334,365],JulianCal.cumMonthLengthsLeap=[0,31,60,91,121,152,182,213,244,274,305,335,366],JulianCal.prototype.getNumMonths=function(year){return 12},JulianCal.prototype.getMonLength=function(month,year){return 2===month&&this.isLeapYear(year)?29:JulianCal.monthLengths[month-1]},JulianCal.prototype.isLeapYear=function(year){var y="number"==typeof year?year:year.year;return MathUtils.mod(y,4)===(0<year?0:3)},JulianCal.prototype.getType=function(){return this.type},Calendar._constructors.julian=JulianCal,module.exports=JulianCal;