mirror of
https://github.com/flynx/types.js.git
synced 2025-10-29 02:20:07 +00:00
added Date.isDateStr(..) and minor tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
3a29f4b5c4
commit
8d5425fe74
4
Date.js
4
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()) },
|
||||
})
|
||||
|
||||
|
||||
|
||||
@ -1872,8 +1872,8 @@ Add a value to the generator sequence at start/end.
|
||||
-> <generator>
|
||||
```
|
||||
|
||||
Value added by `.unshift(..)` will be yielded by `<generator>` "first", i.e. on _next_ call to `.next()`, regardless of the current generator state.
|
||||
|
||||
Value added by `.unshift(..)` will be yielded by `<generator>` "first", i.e. on
|
||||
_next_ call to `.next()`, regardless of the current generator state.
|
||||
|
||||
|
||||
#### `<generator>.promise()`
|
||||
@ -2035,6 +2035,7 @@ currently which may not be the first element in the sequence.
|
||||
Equivalents to [`<generator>`'s `.shift(..)`/`.pop(..)`/..](#generatorshift--generatorpop--generatorgshift--generatorgpop)
|
||||
but returning a reusable `<func>`/`<Generator>`.
|
||||
|
||||
|
||||
#### `<generator>.unshift(..)` / `<generator>.push(..)`
|
||||
|
||||
```bnf
|
||||
|
||||
@ -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": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user