Skip to content

Commit

Permalink
Update dist and version.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocaccamo committed May 9, 2023
1 parent 07a196c commit e4849f3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions dist/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,7 @@ ColorUtil = {

/** global: DateUtil */
/** global: StringUtil */
/** global: isDate */

DateUtil = {
clone: function (date) {
Expand Down Expand Up @@ -1289,6 +1290,27 @@ DateUtil = {
return time;
},

parse: function (date) {
var timestamp;
if (!date) {
return null;
} else if (TypeUtil.isDate(date)) {
return date;
} else if (TypeUtil.isNumber(date)) {
timestamp = date;
return new Date(timestamp);
} else if (TypeUtil.isString(date)) {
timestamp = parseInt(date);
if (!TypeUtil.isNumber(timestamp)) {
timestamp = Date.parse(date);
}
if (TypeUtil.isNumber(timestamp)) {
return new Date(timestamp);
}
}
return null;
},

timestamp: function (date) {
var d = date || new Date();
return d.getTime();
Expand Down
Loading

0 comments on commit e4849f3

Please sign in to comment.