deal with months

allow `-to` and `-from` to work on bare months; also if just a month is
given for an entry, assume the default time on the 1st of the month.
This commit is contained in:
William Minchin 2014-02-10 13:24:42 -07:00
parent b0a29736d7
commit 9652575928
3 changed files with 96 additions and 47 deletions

View file

@ -75,33 +75,33 @@ Feature: Processing of (relative) dates and times
Examples: short months
| date in | date out | entry no |
| jan | 2015-01-01 09:00 | 33 |
| jan | 2014-01-01 09:00 | 33 |
| feb | 2014-02-01 09:00 | 34 |
| mar | 2014-03-01 09:00 | 35 |
| apr | 2014-04-01 09:00 | 36 |
| may | 2014-05-01 09:00 | 37 |
| jun | 2014-06-01 09:00 | 38 |
| jul | 2014-07-01 09:00 | 39 |
| aug | 2014-08-01 09:00 | 40 |
| sep | 2014-09-01 09:00 | 41 |
| oct | 2014-10-01 09:00 | 42 |
| nov | 2014-11-01 09:00 | 43 |
| dec | 2014-12-01 09:00 | 44 |
| sept | 2014-09-01 09:00 | 45 |
| apr | 2013-04-01 09:00 | 36 |
| may | 2013-05-01 09:00 | 37 |
| jun | 2013-06-01 09:00 | 38 |
| jul | 2013-07-01 09:00 | 39 |
| aug | 2013-08-01 09:00 | 40 |
| sep | 2013-09-01 09:00 | 41 |
| oct | 2013-10-01 09:00 | 42 |
| nov | 2013-11-01 09:00 | 43 |
| dec | 2013-12-01 09:00 | 44 |
| sept | 2013-09-01 09:00 | 45 |
Examples: long months
| date in | date out | entry no |
| january | 2015-01-01 09:00 | 46 |
| january | 2014-01-01 09:00 | 46 |
| february | 2014-02-01 09:00 | 47 |
| march | 2014-03-01 09:00 | 48 |
| april | 2014-04-01 09:00 | 49 |
| june | 2014-06-01 09:00 | 50 |
| july | 2014-07-01 09:00 | 51 |
| august | 2014-08-01 09:00 | 52 |
| september | 2014-09-01 09:00 | 53 |
| october | 2014-10-01 09:00 | 54 |
| november | 2014-11-01 09:00 | 55 |
| december | 2014-12-01 09:00 | 56 |
| april | 2013-04-01 09:00 | 49 |
| june | 2013-06-01 09:00 | 50 |
| july | 2013-07-01 09:00 | 51 |
| august | 2013-08-01 09:00 | 52 |
| september | 2013-09-01 09:00 | 53 |
| october | 2013-10-01 09:00 | 54 |
| november | 2013-11-01 09:00 | 55 |
| december | 2013-12-01 09:00 | 56 |
Examples: month + day (no year)
# unless within 28 days, assumed to be the last occurance