I need to interpret relative date string like:
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:
Try it out here (be sure to check allow relative)
In my experience, in American English "this" always means the next immediate occurence of the day. If it is Monday, "this Wednesday" means the day after tomorrow. Typically, if it is Monday, "this Tuesday" is preferentially referred to as "tomorrow" -- I cannot remember anyone ever saying "this Tuesday" on a Monday, unless they thought it was currently Sunday.
If I say "next Wednesday" on a Wednesday, I mean a week from today. If I say "next Wednesday" on a Tuesday, however, I might mean a week from tomorrow, or I might mean tomorrow -- it would depend upon context and is thus rather "squishy". Most Yanks would interpret that as a week from tomorrow. I think. I would, anyway.