midnight = 12am

noon = 12pm
This commit is contained in:
snowleo 2011-08-23 13:20:35 +02:00 committed by KHobbits
parent bb32ec9567
commit 27adc21446

View File

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