Dates
+ Fixed bug with 'socm' date calculation that failed on some days, by simplifying the implementation.
This commit is contained in:
@@ -71,6 +71,8 @@ Bugs
|
|||||||
abbreviation.minimum is greater than 4.
|
abbreviation.minimum is greater than 4.
|
||||||
+ Fixed bug where shadow files are not properly created when there is a missing
|
+ Fixed bug where shadow files are not properly created when there is a missing
|
||||||
.taskrc file (thanks to Pietro Cerutti).
|
.taskrc file (thanks to Pietro Cerutti).
|
||||||
|
+ Fixed bug with 'socm' date calculation that failed on some days, by
|
||||||
|
simplifying the implementation.
|
||||||
|
|
||||||
------ old releases ------------------------------
|
------ old releases ------------------------------
|
||||||
|
|
||||||
|
|||||||
14
src/Date.cpp
14
src/Date.cpp
@@ -830,8 +830,7 @@ bool Date::isRelativeDate (const std::string& input)
|
|||||||
found == "eocw" ||
|
found == "eocw" ||
|
||||||
found == "sow" ||
|
found == "sow" ||
|
||||||
found == "soww" ||
|
found == "soww" ||
|
||||||
found == "socw" ||
|
found == "socw")
|
||||||
found == "socm")
|
|
||||||
{
|
{
|
||||||
if (found == "eow" || found == "eoww")
|
if (found == "eow" || found == "eoww")
|
||||||
dow = 5;
|
dow = 5;
|
||||||
@@ -850,9 +849,6 @@ bool Date::isRelativeDate (const std::string& input)
|
|||||||
else
|
else
|
||||||
today += (dow - today.dayOfWeek ()) * 86400;
|
today += (dow - today.dayOfWeek ()) * 86400;
|
||||||
|
|
||||||
if (found == "socm")
|
|
||||||
today -= (today.day () - 1) * 86400;
|
|
||||||
|
|
||||||
int m, d, y;
|
int m, d, y;
|
||||||
today.toMDY (m, d, y);
|
today.toMDY (m, d, y);
|
||||||
Date then (m, d, y);
|
Date then (m, d, y);
|
||||||
@@ -907,6 +903,14 @@ bool Date::isRelativeDate (const std::string& input)
|
|||||||
_t = then._t;
|
_t = then._t;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (found == "socm")
|
||||||
|
{
|
||||||
|
int m = today.month ();
|
||||||
|
int y = today.year ();
|
||||||
|
Date then (m, 1, y);
|
||||||
|
_t = then._t;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else if (found == "som")
|
else if (found == "som")
|
||||||
{
|
{
|
||||||
int m = today.month () + 1;
|
int m = today.month () + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user