Last active
November 20, 2015 09:52
-
-
Save jorinvo/3d3e100a2cdb8d5418fb to your computer and use it in GitHub Desktop.
readable?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const toISOString = ifElse( | |
either(isNil, compose(isEmpty, trim)), | |
always(null), | |
d => new Date(d).toISOString() | |
) | |
function toISOString (date) { | |
if (isNil(date) || isEmpty(date.trim())) { | |
return null | |
} | |
return new Date(date).toISOString() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment