Skip to content

Commit e4849f3

Browse files
committed
Update dist and version.
1 parent 07a196c commit e4849f3

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

dist/utils.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,7 @@ ColorUtil = {
11341134

11351135
/** global: DateUtil */
11361136
/** global: StringUtil */
1137+
/** global: isDate */
11371138

11381139
DateUtil = {
11391140
clone: function (date) {
@@ -1289,6 +1290,27 @@ DateUtil = {
12891290
return time;
12901291
},
12911292

1293+
parse: function (date) {
1294+
var timestamp;
1295+
if (!date) {
1296+
return null;
1297+
} else if (TypeUtil.isDate(date)) {
1298+
return date;
1299+
} else if (TypeUtil.isNumber(date)) {
1300+
timestamp = date;
1301+
return new Date(timestamp);
1302+
} else if (TypeUtil.isString(date)) {
1303+
timestamp = parseInt(date);
1304+
if (!TypeUtil.isNumber(timestamp)) {
1305+
timestamp = Date.parse(date);
1306+
}
1307+
if (TypeUtil.isNumber(timestamp)) {
1308+
return new Date(timestamp);
1309+
}
1310+
}
1311+
return null;
1312+
},
1313+
12921314
timestamp: function (date) {
12931315
var d = date || new Date();
12941316
return d.getTime();

0 commit comments

Comments
 (0)