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
|
Leon Grünewald
|
||||||
Ivo Forlin
|
Ivo Forlin
|
||||||
aMOPel
|
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
|
- Add ':today' hint
|
||||||
|
|
||||||
------ current release ---------------------------
|
------ current release ---------------------------
|
||||||
|
|
|
@ -189,17 +189,16 @@ bool expandIntervalHint (
|
||||||
// Some require math.
|
// Some require math.
|
||||||
if (hint == ":lastweek")
|
if (hint == ":lastweek")
|
||||||
{
|
{
|
||||||
// Note: Simply subtracting (7 * 86400) from sow, eow fails to consider
|
// Note: Simply subtracting (7 * 86400) from sow/sonw fails to consider daylight saving time.
|
||||||
// daylight savings.
|
|
||||||
Datetime sow ("sow");
|
Datetime sow ("sow");
|
||||||
int sy = sow.year ();
|
int sy = sow.year ();
|
||||||
int sm = sow.month ();
|
int sm = sow.month ();
|
||||||
int sd = sow.day ();
|
int sd = sow.day ();
|
||||||
|
|
||||||
Datetime eow ("eow");
|
Datetime sonw ("sonw");
|
||||||
int ey = eow.year ();
|
int ey = sonw.year ();
|
||||||
int em = eow.month ();
|
int em = sonw.month ();
|
||||||
int ed = eow.day ();
|
int ed = sonw.day ();
|
||||||
|
|
||||||
sd -= 7;
|
sd -= 7;
|
||||||
if (sd < 1)
|
if (sd < 1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue