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

michaeldrennen / natural-date / 9 / 1
97%
master: 97%

Build:
DEFAULT BRANCH: master
Ran 08 Apr 2018 04:36PM UTC
Files 29
Run time 1s
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

08 Apr 2018 04:34PM UTC coverage: 94.819% (+0.3%) from 94.554%
9.1

push

travis-ci

michaeldrennen
Adding some code that handles the string:

Between Thanksgiving and Christmas 2017

The parse function starts by grouping them like:

Between (Thanksgiving) and (Christmas 2017)

Now assume that it's the year 2018.
The parse function will think that the Thanksgiving string means "Thanksgiving 2018"

However, that's obviously not what the user intended.

So the additional code checks to see if the first parsed section is of type "yearlessDate", and if so, it will replace the year with the year in the end date's parsed string.

Shit... now that I think about it... I will need to add more intelligent code. Think about this:

A user enters:
Between Christmas and Valentine's Day 2017

Well obviously they don't mean Christmas 2017. We need to assume that users list their dates in chronological order to be parsed.

In this case, I need to check if the NEW startDate is actually before the endDate. If it is not, then I need to subtract a year and reparse. Simply subtracting a year won't do, because for dates like "Thanksgiving", changing the year will most likely change the day of month as well. (Since Thanksgiving is the 4th Thursday in November. Look for that change in the next patch.

604 of 637 relevant lines covered (94.82%)

17.02 hits per line

Source Files on job 9.1
  • Tree
  • List 0
  • Changed 4
  • Source Changed 2
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 8
  • Travis Job 9.1
  • cf667b0e on github
  • Prev Job for on master (#6.1)
  • Next Job for on master (#10.1)
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