Changeset 26219 in osm for applications/editors/josm/plugins/OpeningHoursEditor
- Timestamp:
- 2011-06-30T15:01:00+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OpeningTimeUtils.java
r26215 r26219 211 211 } 212 212 213 /** 214 * @param minutes integer in range from 0 and 24*60 inclusive 215 * @param hourMode 12 or 24 hour clock 216 * @param showPeriod if 12 hour clock is chosen, the "AM"/"PM" will be shown 217 * @return a formatted string of the time (for example "01:45 PM" or "13:45") 218 */ 213 219 public static String timeString(int minutes, ClockSystem hourMode, boolean showPeriod) { 214 220 int h = minutes / 60; 215 221 String period = ""; 216 222 if (hourMode == ClockSystem.TWELVE_HOURS) { 217 if (showPeriod) { 218 period = h <= 12 ? " AM" : " PM"; 219 } 220 h %= 12; 221 if (h == 0) { 222 h = 12; 223 if (h == 24) 224 return "midnight"; 225 else { 226 if (showPeriod) { 227 period = h < 12 ? " AM" : " PM"; 228 } 229 h %= 12; 230 if (h == 0) { 231 h = 12; 232 } 223 233 } 224 234 }
Note:
See TracChangeset
for help on using the changeset viewer.