Commit 89f4810
committed
formalize grammar of relative time strings and use nom to parse them
BREAKING CHANGES: this commit introduced two breaking changes:
- Keyword `ago` semantic change (to be consistent with GNU date)
The `ago` keyword now applies to individual date-time
displacement (the one that immediately precedes it) and can
be specified multiple times. For example, "1 day ago 2 days ago"
gives a combined effect of "3 days ago", and "1 day 2 days ago"
gives a combined effect of "1 day ago".
In previous implementation, `ago` can only be specified once at
the end of the relative time string, and it applies to all
date-time displacements as a whole. So "1 day ago 2 days ago"
is invalid and "1 day 2 days ago" gives a global effect of
"3 days ago".
- Relative time strings like "lastweek" or "nextmonth" are now
invalid, and space(s) are required in between the shift and the
time unit.1 parent b9630d4 commit 89f4810
File tree
4 files changed
+674
-306
lines changed- src
- parse
4 files changed
+674
-306
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments