Created
October 12, 2021 08:13
-
-
Save phuoctamm/c33e5049d987dc38f995c0728d23b490 to your computer and use it in GitHub Desktop.
parse.js
This file contains hidden or 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
export const toDateParse = (date, dateFormat = 'MM/dd/yyyy') => { | |
try { | |
return parse(date, dateFormat, new Date()); | |
} catch (e) { | |
return false; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment