Last active
March 5, 2016 20:07
-
-
Save andevsoftware/b9a5a5a287ea0fc8516a to your computer and use it in GitHub Desktop.
TSValidate.Validators.Regex
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
import Regex = TSValidate.Validators.Regex; | |
validator.add('created_at', new Regex() | |
.pattern(/^[0-9]{4}[-\/](0[1-9]|1[12])[-\/](0[1-9]|[12][0-9]|3[01])$/) | |
.message('The creation date is invalid') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment