File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -1134,6 +1134,7 @@ ColorUtil = {
11341134
11351135 /** global: DateUtil */
11361136/** global: StringUtil */
1137+ /** global: isDate */
11371138
11381139DateUtil = {
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 ( ) ;
You can’t perform that action at this time.
0 commit comments