I need to interpret relative date string like:
- last Friday
- this Tuesday
- next Wednesday
The "Last Friday" form is easy (take the most recent Friday that is not today) but what about "this" vs. "next"? Could "this Wednesday" be yesterday on a Thursday? Could "this" and "next" Friday be the same day in some cases and a week apart in others?
p.s. Given that my target audience is American, I'm primarily interested in the US English vernacular use of the term and slightly less interested in other non-US English (for instance en-gb
) usages so if you are non-US please say where you are from.
My current thinking:
- Last X: the most recent X not including today.
- This X: the immediate next X not including today.
- Next X: the X in the next week (with the start of the week being a bit arbitrary).
Try it out here (be sure to check allow relative)