Sign in
apache
/
superset
/
fc02f0c7fc19dd176920fda82d794aebe33c5169
/
.
/
superset-frontend
/
packages
/
superset-ui-core
/
src
/
time-format
/
utils
/
stringifyTimeInput.ts
blob: 0fd7c2467312502c67f461d708a606752b914eb5 [
file
] [
log
] [
blame
]
export
default
function
stringifyTimeInput
(
value
:
Date
|
number
|
undefined
|
null
,
fn
:
(
time
:
Date
)
=>
string
,
)
{
if
(
value
===
null
||
value
===
undefined
)
{
return
`${value}`
;
}
return
fn
(
value
instanceof
Date
?
value
:
new
Date
(
value
));
}