diff --git a/Date.js b/Date.js index 0186543..b24eb55 100644 --- a/Date.js +++ b/Date.js @@ -57,7 +57,7 @@ object.Mixin('DateMixin', 'soft', { str = ' '+str var c = (/[^a-z](m(illi)?(-)?s(ec(ond(s)?)?)?)$/i.test(str) - || /^[0-9]*(\.[0-9]+)?$/.test(str) ) ? + || /^([0-9]*\.)?[0-9]+$/.test(str) ) ? 1 : /[^a-z]s(ec(ond(s)?)?)?$/i.test(str) ? 1000 @@ -75,6 +75,8 @@ object.Mixin('DateMixin', 'soft', { isPeriod: function(str){ return !isNaN(this.str2ms(str)) }, + isDateStr: function(str){ + return !isNaN(new Date(str).valueOf()) }, }) diff --git a/README.md b/README.md index 1cfdac5..9d57e13 100644 --- a/README.md +++ b/README.md @@ -1872,8 +1872,8 @@ Add a value to the generator sequence at start/end. -> ``` -Value added by `.unshift(..)` will be yielded by `` "first", i.e. on _next_ call to `.next()`, regardless of the current generator state. - +Value added by `.unshift(..)` will be yielded by `` "first", i.e. on +_next_ call to `.next()`, regardless of the current generator state. #### `.promise()` @@ -2035,6 +2035,7 @@ currently which may not be the first element in the sequence. Equivalents to [``'s `.shift(..)`/`.pop(..)`/..](#generatorshift--generatorpop--generatorgshift--generatorgpop) but returning a reusable ``/``. + #### `.unshift(..)` / `.push(..)` ```bnf diff --git a/package.json b/package.json index 5f80d66..fef721e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-types", - "version": "6.9.3", + "version": "6.9.4", "description": "Generic JavaScript types and type extensions...", "main": "main.js", "scripts": {