UNPKG
@form-create/utils
Version:
latest (2.6.3)
next (3.3.0)
super (2.7.17)
3.3.0
3.3.0-alpha.0
3.2.31
3.2.23
3.2.18
3.2.15
3.2.14
3.2.0
3.1.30
3.1.29
3.1.23
3.1.15
3.1.12
3.1.3
3.1.2
3.1.1
3.1.0
3.0.0-alpha.4
3.0.0-alpha.3
3.0.0-alpha.1
2.7.17
2.7.8
2.7.0
2.7.0-alpha.0
2.6.3
2.6.2
2.6.1
2.6.0
2.5.36
2.5.35
2.5.31
2.5.27
2.5.18
2.5.17
2.5.15
2.5.11
2.5.10
2.5.9
2.5.7
2.5.6
2.5.0-alpha.4
2.5.0-alpha.1
1.0.15
1.0.11
1.0.8
1.0.7
1.0.4
1.0.0
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
www.form-create.com
xaboy/form-create
@form-create/utils
/
lib
/
todate.js
11 lines
(9 loc)
•
253 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
is
from
'./type'
;
export
default
function
toDate
(
timeStamp
) {
if
(is.
Date
(timeStamp))
return
timeStamp;
else
{
let
date =
new
Date
(timeStamp);
return
date.
toString
() ===
'Invalid Date'
? timeStamp : date; } }