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

@ -93,7 +93,7 @@ static void midsommar (struct tm* t)
static void midsommarafton (struct tm* t)
{
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_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);
}
else if (closeEnough ("midsommarafton", name, minimum))
else if (closeEnough ("midsommarafton", name, minimum) ||
closeEnough ("juhannus", name, minimum))
{
Variant valueNow = Variant (mktime (t), Variant::type_date);
midsommarafton (t);