Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve date asserts #116

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

nunofgs
Copy link
Contributor

@nunofgs nunofgs commented Jul 4, 2016

This PR:

  • Improves the date assert by validating using the moment API. This now allows the following assert to work:
new Assert().Date({ format: 'MM/YYYY' }).validate('11/2016');
  • Adds optional format to NullOrDate assert.
  • Improves date validation in the date diff asserts by using moment's parsing.
  • Fixes a typo in the README.

Note: due to the changes in the way dates are handled, this PR could constitute a BC and releasing a major bump is recommended.

@nunofgs nunofgs added the enhancement New feature or request label Jul 4, 2016
@nunofgs nunofgs self-assigned this Jul 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants