juhannus as an alternative name for midsommarafton

This commit is contained in:
Lynoure Braakman 2016-03-27 22:34:57 +02:00 committed by Paul Beckingham
parent 7f91e014a0
commit ea8a499769
5 changed files with 12 additions and 4 deletions

View file

@ -128,6 +128,7 @@ The following submitted code, packages or analysis, and deserve special thanks:
Kent R. Spillner Kent R. Spillner
Konstantin Vorobyev Konstantin Vorobyev
Tom Sydney Kerckhove Tom Sydney Kerckhove
Lynoure Braakman
Thanks to the following, who submitted detailed bug reports and excellent Thanks to the following, who submitted detailed bug reports and excellent
suggestions: suggestions:

View file

@ -6,8 +6,10 @@
(thanks to Paul Beckingham) (thanks to Paul Beckingham)
- TW-1772 Implementation of circular dependency detection is - TW-1772 Implementation of circular dependency detection is
inefficient (thanks to Michael Meier). inefficient (thanks to Michael Meier).
- TW-1788 Closing a reopened task does not update the end time (thanks - TW-1788 Closing a reopened task does not update the end time
to Ralph Bean). (thanks to Ralph Bean).
- Added 'juhannus' as a synonym for 'midsommarafton'
(thanks to Lynoure Braakman).
- Removed deprecated 'alias._query' setting. - Removed deprecated 'alias._query' setting.
2.5.1 (2016-02-24) 8b4ae3b54b44dfbd00b96cdd6dceb8dfe7cc1ea0 2.5.1 (2016-02-24) 8b4ae3b54b44dfbd00b96cdd6dceb8dfe7cc1ea0

View file

@ -1048,6 +1048,8 @@ task ... due:pentecost
task ... due:midsommar task ... due:midsommar
.br .br
task ... due:midsommarafton task ... due:midsommarafton
.br
task ... due:juhannus
.RE .RE
.SS FREQUENCIES .SS FREQUENCIES

View file

@ -93,7 +93,7 @@ static void midsommar (struct tm* t)
static void midsommarafton (struct tm* t) static void midsommarafton (struct tm* t)
{ {
t->tm_mon = 5; // June. t->tm_mon = 5; // June.
t->tm_mday = 19; // Saturday after 20th. t->tm_mday = 19; // Friday after 19th.
t->tm_hour = t->tm_min = t->tm_sec = 0; // Midnight. t->tm_hour = t->tm_min = t->tm_sec = 0; // Midnight.
t->tm_isdst = -1; // Probably DST, but check. t->tm_isdst = -1; // Probably DST, but check.
@ -491,7 +491,8 @@ bool namedDates (const std::string& name, Variant& value)
value = Variant (mktime (t), Variant::type_date); value = Variant (mktime (t), Variant::type_date);
} }
else if (closeEnough ("midsommarafton", name, minimum)) else if (closeEnough ("midsommarafton", name, minimum) ||
closeEnough ("juhannus", name, minimum))
{ {
Variant valueNow = Variant (mktime (t), Variant::type_date); Variant valueNow = Variant (mktime (t), Variant::type_date);
midsommarafton (t); midsommarafton (t);

View file

@ -146,6 +146,7 @@ int main (int, char**)
Variant var_false; testInit (t, "false", var_false); Variant var_false; testInit (t, "false", var_false);
Variant midsommar; testInit (t, "midsommar", midsommar); Variant midsommar; testInit (t, "midsommar", midsommar);
Variant midsommarafton; testInit (t, "midsommarafton", midsommarafton); Variant midsommarafton; testInit (t, "midsommarafton", midsommarafton);
Variant juhannus; testInit (t, "juhannus", juhannus);
Variant first; testInit (t, "1st", first); Variant first; testInit (t, "1st", first);
Variant second; testInit (t, "2nd", second); Variant second; testInit (t, "2nd", second);
Variant third; testInit (t, "3rd", third); Variant third; testInit (t, "3rd", third);
@ -173,6 +174,7 @@ int main (int, char**)
t.ok (easter < eastermonday, "easter < eastermonday"); t.ok (easter < eastermonday, "easter < eastermonday");
t.ok (easter < midsommarafton, "easter < midsommarafton"); t.ok (easter < midsommarafton, "easter < midsommarafton");
t.ok (midsommarafton < midsommar, "midsommarafton < midsommar"); t.ok (midsommarafton < midsommar, "midsommarafton < midsommar");
t.ok (juhannus == midsommarafton, "juhannus == midsommarafton");
return 0; return 0;
} }