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

chriso / validator.js / 533
99%

Build:
DEFAULT BRANCH: master
Ran 28 Jan 2016 04:08AM UTC
Jobs 4
Files 2
Run time 6s
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

pending completion
533

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%)

512.05 hits per line

Jobs
ID Job ID Ran Files Coverage
1 533.1 28 Jan 2016 04:08AM UTC 0
97.91
Travis Job 533.1
2 533.2 28 Jan 2016 04:08AM UTC 0
97.91
Travis Job 533.2
3 533.3 28 Jan 2016 04:08AM UTC 0
97.91
Travis Job 533.3
4 533.4 28 Jan 2016 04:08AM UTC 0
97.91
Travis Job 533.4
Source Files on build 533
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #533
  • fada563d on github
  • Prev Build on master (#528)
  • Next Build on master (#534)
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