Last active
October 15, 2020 09:22
-
-
Save sambhav2612/7349f373b034e4fb75c704577bf85c14 to your computer and use it in GitHub Desktop.
regex to check for iso date strings under ''
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
console.log(new Date().toISOString().match(/('((?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)')/g).length > 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment