Add "Mitternacht" when it's spooky time.
This commit is contained in:
@@ -165,24 +165,27 @@ String time_to_string(uint8_t hours, uint8_t minutes)
|
||||
}
|
||||
|
||||
// convert hours to 12h format
|
||||
if (hours >= 12)
|
||||
{
|
||||
hours -= 12;
|
||||
}
|
||||
if (minutes >= 20)
|
||||
{
|
||||
hours++;
|
||||
}
|
||||
if (hours == 12)
|
||||
if (hours > 12) // 24h -> 12h, except 12h
|
||||
{
|
||||
hours = 0;
|
||||
hours -= 12;
|
||||
}
|
||||
|
||||
// show hours
|
||||
switch (hours)
|
||||
{
|
||||
case 0:
|
||||
message += "ZWOLF ";
|
||||
if (minutes >= 0 && minutes < 5)
|
||||
{
|
||||
message += "MITTERNACHT ";
|
||||
}
|
||||
else
|
||||
{
|
||||
message += "ZWOLF ";
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
message += "EIN";
|
||||
@@ -223,6 +226,9 @@ String time_to_string(uint8_t hours, uint8_t minutes)
|
||||
case 11:
|
||||
message += "ELF ";
|
||||
break;
|
||||
case 12:
|
||||
message += "ZWOLF ";
|
||||
break;
|
||||
}
|
||||
if (minutes < 5)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user