chrono icon indicating copy to clipboard operation
chrono copied to clipboard

before mar 2 doesn't work

Open bcowgill opened this issue 8 years ago • 2 comments

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.

bcowgill avatar Feb 02 '17 08:02 bcowgill

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] } } ]

alexgorbatchev avatar Jul 03 '17 20:07 alexgorbatchev

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...

shrikrishnaholla avatar Jul 28 '23 05:07 shrikrishnaholla