chai-date-string

Validates a string to have valid date format

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
chai-date-string
110.1.07 years ago7 years agoMinified + gzip package size for chai-date-string in KB

Readme

chai-date-string
Usage example:
var chai = require('chai')
  , expect = chai.expect
  , chaiDateString = require('chai-date-string');

expect('2015-11-12').to.be.a.dateString(); // will pass
expect('2015-24-12').to.be.a.dateString(); // will fail

It will validate time part as well.
The later will fail with message: `AssertionError: expected '2015-24-12' to be a date string.