chrono
chrono copied to clipboard
before mar 2 doesn't work
before march 2 start: 2017-3-2-12-0-0 end: undefined
would expect start to be timestamp 0 or be able to configure a value for earliest date we can search.
before x
sounds very ambiguous to me... it could be any value that is < x
. The value that is parsed here is march 2
.
> c.parse('before march 2')
[ ParsedResult {
ref: 2017-07-03T20:06:11.442Z,
index: 7,
text: 'march 2',
tags: { ENMonthNameMiddleEndianParser: true },
start: ParsedComponents { knownValues: [Object], impliedValues: [Object] } } ]
If before X
is confusing, we could go with upto
:
Ex: upto 2 weeks ago
, upto a month ago
A hack to achieve this is to say from Jan 1, 1970 to 2 weeks ago
(from epoch), but it's an ugly hack and a lot of the time is not what we are looking for anyway, since we might want to dynamically resolve start date.
The idea here is for result.start.date()
to be undefined
, and only for result.end.date()
to be resolved. Hope that makes sense...