Skip to content

Commit

Permalink
update JDate to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
arashm committed Aug 17, 2014
1 parent 89a3173 commit bf779c3
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 37 deletions.
64 changes: 33 additions & 31 deletions build/js/jcal.js
Original file line number Diff line number Diff line change
Expand Up @@ -957,13 +957,35 @@ exports.normalize = function (event) {

});

require.register("arashm~jdate@master", function (exports, module) {
module.exports = require("arashm~jdate@master/lib/jdate.js");
require.register("[email protected]", function (exports, module) {

module.exports = function(arr, n){
var ret = [];
var group = [];
var len = arr.length;
var per = len * (n / len);

for (var i = 0; i < len; ++i) {
group.push(arr[i]);
if ((i + 1) % n == 0) {
ret.push(group);
group = [];
}
}

if (group.length) ret.push(group);

return ret;
};
});

require.register("[email protected]", function (exports, module) {
module.exports = require("[email protected]/lib/jdate.js");


});

require.register("arashm~jdate@master/lib/converter.js", function (exports, module) {
require.register("arashm~jdate@v0.1.1/lib/converter.js", function (exports, module) {
(function (root) {

/*
Expand Down Expand Up @@ -1182,13 +1204,13 @@ function d2g(jdn) {

});

require.register("arashm~jdate@master/lib/jdate.js", function (exports, module) {
require.register("arashm~jdate@v0.1.1/lib/jdate.js", function (exports, module) {
/*
* https://github.com/arashm/JDate
* @author: Arash Mousavi
* @version: 0.1.0
* @version: 0.1.1
*/
var jalali = require("arashm~jdate@master/lib/converter.js")
var jalali = require("arashm~jdate@v0.1.1/lib/converter.js")
, map = require("[email protected]");

module.exports = JDate;
Expand Down Expand Up @@ -1426,10 +1448,12 @@ JDate.daysInMonth = function (year, month) {
if (month < 0) {
month += 12
year -= 1
} else if (month == 0) {
month = 12
}
if (month < 6) {
if (month <= 6) {
return 31
} else if (month < 11) {
} else if (month <= 11) {
return 30
} else if (JDate.isLeapYear(year)) {
return 30
Expand All @@ -1441,28 +1465,6 @@ JDate.daysInMonth = function (year, month) {

});

require.register("[email protected]", function (exports, module) {

module.exports = function(arr, n){
var ret = [];
var group = [];
var len = arr.length;
var per = len * (n / len);

for (var i = 0; i < len; ++i) {
group.push(arr[i]);
if ((i + 1) % n == 0) {
ret.push(group);
group = [];
}
}

if (group.length) ret.push(group);

return ret;
};
});

require.register("jcal", function (exports, module) {
module.exports = require("jcal/lib/jcal.js");

Expand All @@ -1475,7 +1477,7 @@ var event = require("[email protected]")
, domify = require("[email protected]")
, template = require("jcal/lib/template.js")
, classes = require("[email protected]")
, jdate = require("arashm~jdate@master")
, jdate = require("arashm~jdate@v0.1.1")
, inGroupsOf = require("[email protected]")
, Emitter = require("[email protected]")
, normalize = require("[email protected]")
Expand Down
2 changes: 1 addition & 1 deletion build/js/jcal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"component/in-groups-of": "1.0.0",
"component/object": "*",
"stephenmathieson/normalize": "*",
"arashm/jdate": "*"
"arashm/jdate": "v0.1.1"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jdate",
"version": "0.1.0",
"version": "0.1.1",
"description": "A Jalali to Gregorian converter with support of formatting output",
"keywords": [
"date",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* https://github.com/arashm/JDate
* @author: Arash Mousavi
* @version: 0.1.0
* @version: 0.1.1
*/
var jalali = require('./converter')
, map = require('map');
Expand Down Expand Up @@ -241,10 +241,12 @@ JDate.daysInMonth = function (year, month) {
if (month < 0) {
month += 12
year -= 1
} else if (month == 0) {
month = 12
}
if (month < 6) {
if (month <= 6) {
return 31
} else if (month < 11) {
} else if (month <= 11) {
return 30
} else if (JDate.isLeapYear(year)) {
return 30
Expand Down

0 comments on commit bf779c3

Please sign in to comment.