diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/menus/main_menu.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 6c828ce1be..022fb9b7e7 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c | |||
@@ -211,22 +211,18 @@ static bool show_info(void) | |||
211 | talk_id(VOICE_CURRENT_TIME, true); | 211 | talk_id(VOICE_CURRENT_TIME, true); |
212 | if (global_settings.timeformat == 1) | 212 | if (global_settings.timeformat == 1) |
213 | { | 213 | { |
214 | /* Voice the time in 12 hour format */ | 214 | bool pm = false; |
215 | if (tm->tm_hour == 0) | 215 | int hour = tm->tm_hour; |
216 | |||
217 | if (hour >= 12) | ||
216 | { | 218 | { |
217 | /* Make it say 12 am instead of 0 am */ | 219 | pm = true; |
218 | talk_value(12, UNIT_INT, true); | 220 | hour -= 12; |
219 | } | ||
220 | else if (tm->tm_hour <= 12) | ||
221 | { | ||
222 | /* If between 0 and 12, we voice the hour as-is */ | ||
223 | talk_value(tm->tm_hour, UNIT_INT, true); | ||
224 | } | ||
225 | else | ||
226 | { | ||
227 | /* Subtract 12 hours if we're past noon */ | ||
228 | talk_value(tm->tm_hour-12, UNIT_INT, true); | ||
229 | } | 221 | } |
222 | if (hour == 0) | ||
223 | hour = 12; | ||
224 | |||
225 | talk_value(hour, UNIT_INT, true); | ||
230 | 226 | ||
231 | /* Voice the minutes */ | 227 | /* Voice the minutes */ |
232 | if (tm->tm_min == 0) | 228 | if (tm->tm_min == 0) |
@@ -239,15 +235,7 @@ static bool show_info(void) | |||
239 | talk_value(tm->tm_min, UNIT_INT, true); | 235 | talk_value(tm->tm_min, UNIT_INT, true); |
240 | } | 236 | } |
241 | 237 | ||
242 | /* Voice the suffix */ | 238 | talk_id(pm ? VOICE_PM : VOICE_AM, true); |
243 | if (tm->tm_hour >= 12) | ||
244 | { | ||
245 | talk_id(VOICE_PM, true); | ||
246 | } | ||
247 | else | ||
248 | { | ||
249 | talk_id(VOICE_AM, true); | ||
250 | } | ||
251 | } | 239 | } |
252 | else | 240 | else |
253 | { | 241 | { |