mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
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:
parent
0b641da598
commit
40e6c4adaf
3 changed files with 10 additions and 6 deletions
3
AUTHORS
3
AUTHORS
|
@ -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
|
||||
|
|
|
@ -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 ---------------------------
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue