• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

chriso / validator.js / 533 / 2
99%
master: 99%

Build:
DEFAULT BRANCH: master
Ran 28 Jan 2016 04:08AM UTC
Files 2
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Jan 2016 04:08AM UTC coverage: 97.908%. Remained the same
533.2

push

travis-ci

chriso
Fix a timezone issue in isDate()

The validator accepts ISO 8601 dates which include "%Y-%m-%d" and
"%Y-%m-%d %H:%M". The validator makes use of Date.parse() to parse
the date before checking if the date is invalid (e.g. 2015-02-29).
The built-in Date.parse() function interprets "%Y-%m-%d" dates in
GMT but "%Y-%m-%d %H:%M" in the user's timezone. This caused the
validator to apply an incorrect timezone offset which then caused
it to get out of sync with the built-in Date.parse() function.
Because of this mismatch, certain dates such as 2011-12-21 were
being marked as invalid when the user had a timezone offset < 0,
e.g. in PST, since the date would become 2011-12-20 after the
incorrect timezone offset was applied.

This fixes the function that determines the timezone in the date.
It now checks for the special "%Y-%m-%d" case and returns a
timezone offset of 0 (GMT).

cc #480

468 of 478 relevant lines covered (97.91%)

128.01 hits per line

Source Files on job 533.2
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 533
  • Travis Job 533.2
  • fada563d on github
  • Prev Job for on master (#528.2)
  • Next Job for on master (#534.3)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc