1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-01 12:20:59 +02:00

midnight = 12am

noon = 12pm
This commit is contained in:
snowleo
2011-08-23 13:20:35 +02:00
committed by KHobbits
parent 1697ca939a
commit 33d74d0762

View File

@@ -155,10 +155,6 @@ public final class DescParseTickFormat
int hours = 0;
int minutes = 0;
if (desc.endsWith("pm"))
{
hours += 12;
}
desc = desc.toLowerCase().replaceAll("[^0-9]", "");
@@ -189,6 +185,16 @@ public final class DescParseTickFormat
{
throw new NumberFormatException();
}
if (desc.endsWith("pm") && hours != 12)
{
hours += 12;
}
if (desc.endsWith("am") && hours == 12)
{
hours -= 12;
}
return hoursMinutesToTicks(hours, minutes);
}