Use 'sonw' instead of 'eow'

With GothenburgBitFactory/taskwarrior#2519, all 'end of *' named dates have been changed to be the last minute of the respective date.
This caused the ':lastweek' hint to miss the last day of its range.

Closes #493

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2023-10-09 17:10:28 +02:00 committed by Thomas Lauf
parent 0b641da598
commit 40e6c4adaf
3 changed files with 10 additions and 6 deletions

View file

@ -118,3 +118,6 @@ Thanks to the following, who submitted detailed bug reports and excellent sugges
Leon Grünewald
Ivo Forlin
aMOPel
Per Møldrup-Dalum
Beshoy Girgis
Sergey Zhuravlevich

View file

@ -1,3 +1,5 @@
- #493 :lastweek doesn't count last Sunday
(thanks to Saulius Krasuckas, Per Møldrup-Dalum, Beshoy Girgis, Sergey Zhuravlevich)
- Add ':today' hint
------ current release ---------------------------

View file

@ -189,17 +189,16 @@ bool expandIntervalHint (
// Some require math.
if (hint == ":lastweek")
{
// Note: Simply subtracting (7 * 86400) from sow, eow fails to consider
// daylight savings.
// Note: Simply subtracting (7 * 86400) from sow/sonw fails to consider daylight saving time.
Datetime sow ("sow");
int sy = sow.year ();
int sm = sow.month ();
int sd = sow.day ();
Datetime eow ("eow");
int ey = eow.year ();
int em = eow.month ();
int ed = eow.day ();
Datetime sonw ("sonw");
int ey = sonw.year ();
int em = sonw.month ();
int ed = sonw.day ();
sd -= 7;
if (sd < 1)