How do I make this interpret mon, tue, thu etc as the most recent day instead of the nearest day?
How do I make chrono-node interpret mon, tue, thu etc as the most recent day( in the past) instead of the nearest day which is sometimes in future?
As described in the README:
Chrono lets you define a reference date using
chrono.parse(text, ref)andchrono.parseDate(text, ref).
For your case just use the current date a week ago as reference date:
var moment = require('moment');
chrono.parse('mon', moment().subtract(1, 'week');
This 1 week back ref date solution would disturb the interpretation of terms like 'yesterday' ' 2 days ago' etc.
You are right it affects other parsers. There is also still the issue that e.g.tue by default will be interpreted as the closest Tuesday to the ref date, so that with the 1 week back ref solution it might even be 2 weeks back.
I think you have to write your own refiner to accomplish exactly what you need, something like this:
https://github.com/wanasit/chrono/issues/19#issuecomment-164419896