IDEA-102184 12-hour Clock should show 12:xx instead of 0:xx

This commit is contained in:
Vassiliy Kudryashov
2013-04-08 17:22:06 +04:00
parent fa3b8d1441
commit 4b0b3385ac
@@ -118,6 +118,9 @@ public class ClockPanel extends JComponent {
g.setColor(UIManager.getColor("Label.foreground"));
myCalendar.setTimeInMillis(System.currentTimeMillis());
int hours = myCalendar.get(is24Hours ? HOUR_OF_DAY : HOUR);
if (hours == 0 && !is24Hours) {
hours = 12;
}
int minutes = myCalendar.get(MINUTE);
int x = 0;
int y = (getHeight() - h) / 2;