We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c1760be commit df7267cCopy full SHA for df7267c
1 file changed
src/Datetime.cpp
@@ -1939,9 +1939,11 @@ bool Datetime::initializeEonw (Pig& pig)
1939
{
1940
time_t now = time (nullptr);
1941
struct tm* t = localtime (&now);
1942
-
1943
- t->tm_mday += 15 - t->tm_wday;
1944
t->tm_hour = t->tm_min = t->tm_sec = 0;
+
+ int extra = (t->tm_wday + 6) % 7;
1945
+ t->tm_mday += 14 - extra;
1946
1947
t->tm_isdst = -1;
1948
_date = mktime (t);
1949
return true;
0 commit comments