From 971c7c223317bf54b9285479f292b63e935fd109 Mon Sep 17 00:00:00 2001 From: Mario Sanchez Prada Date: Thu, 3 Dec 2015 00:05:57 +0000 Subject: [PATCH] Do not incllude 'is is' / 'it is a' prefixes in the final string --- extension.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/extension.js b/extension.js index dfb73e8..8edb807 100644 --- a/extension.js +++ b/extension.js @@ -112,8 +112,6 @@ const MONTHS = [ ]; const WORDS = { - it_is: 'it is', - it_is_a: 'it is a', o_clock: "o'clock", noon: 'noon', midnight: 'midnight', @@ -186,26 +184,23 @@ function timeToWords(hours, minutes) { if (wordMinutes != 0) { if (wordMinutes == 15) { - res = WORDS.it_is_a + ' ' + WORDS.quarter + ' ' + WORDS.past + ' '; + res = WORDS.quarter + ' ' + WORDS.past + ' '; } else if (wordMinutes == 45) { - res = WORDS.it_is_a + ' ' + WORDS.quarter + ' ' + WORDS.to + ' '; + res = WORDS.quarter + ' ' + WORDS.to + ' '; wordHours = (wordHours + 1) % 24; } else if (wordMinutes == 30) { - res = WORDS.it_is + ' ' + WORDS.half + ' ' + WORDS.past + ' '; + res = WORDS.half + ' ' + WORDS.past + ' '; } else if (wordMinutes < 30) { - res = WORDS.it_is + ' ' + appendNumber(wordMinutes) + ' ' + WORDS.past + ' '; + res = appendNumber(wordMinutes) + ' ' + WORDS.past + ' '; } else { - res = WORDS.it_is + ' ' + appendNumber(60 - wordMinutes) + ' ' + WORDS.to + ' '; + res = appendNumber(60 - wordMinutes) + ' ' + WORDS.to + ' '; wordHours = (wordHours + 1) % 24; } } - else { - res = WORDS.it_is + ' '; - } if (wordHours == 0) { res += WORDS.midnight;