Skip to content

Commit cdc5f30

Browse files
committed
Fix Date.extend().
1 parent 71b5c07 commit cdc5f30

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

changes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- fixed: `409` system route
1414
- fixed: requests with `range` header and bad values
1515
- fixed: `clearSchedule()`
16+
- fixed: `Date.extend()` problem with months
1617

1718
======= 2.9.2
1819

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"name": "Tema Smirnov",
9191
"email": "github.tema@smirnov.one"
9292
}],
93-
"version": "2.9.3-5",
93+
"version": "2.9.3-6",
9494
"homepage": "http://www.totaljs.com",
9595
"bugs": {
9696
"url": "https://github.com/totaljs/framework/issues",

utils.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,16 +2567,16 @@ Date.prototype.extend = function(date) {
25672567
tmp = +arr[0];
25682568
dt.setFullYear(tmp);
25692569

2570-
if (arr[1]) {
2571-
tmp = +arr[1];
2572-
!isNaN(tmp) && dt.setMonth(tmp - 1);
2573-
}
2574-
25752570
if (arr[2]) {
25762571
tmp = +arr[2];
25772572
!isNaN(tmp) && dt.setDate(tmp);
25782573
}
25792574

2575+
if (arr[1]) {
2576+
tmp = +arr[1];
2577+
!isNaN(tmp) && dt.setMonth(tmp - 1);
2578+
}
2579+
25802580
continue;
25812581
}
25822582

0 commit comments

Comments
 (0)