Skip to content
Snippets Groups Projects
Verified Commit 5fcf3fac authored by Tuomas Ahola's avatar Tuomas Ahola
Browse files

approxidate: overwrite mday for now, today and yesterday


In c27cc94f (approxidate: handle pending number for
"specials", 2018-11-02) "Jan 5 yesterday" was given as
an example of an approxidate string where "the number
shouldn't be respected at all".  Likewise, "tea today"
shouldn't respect the usual tea-time logic of going
backwards in time; instead "today" should be able to
override the mday change possibly caused by "tea".

Add a new format "today" as an alias of "now", and make
it and "yesterday" overwrite mday.  Make date_time() use
the new method for deferred mday adjustment, and add tests
to cover the changes.

Signed-off-by: default avatarTuomas Ahola <taahol@utu.fi>
parent 1c241daf
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment