diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 984a2c1b..55970dee 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1017,7 +1017,7 @@ "message": "Timezone Offset" }, "tzOffsetHelp": { - "message": "Time zone offset from UTC, in minutes. This is applied to the GPS time for logging and time-stamping of Blackbox logs. (Default = 0)" + "message": "Time zone offset from UTC. This is applied to the GPS time for logging and time-stamping of Blackbox logs. (Default = 0 mins)" }, "tzAutomaticDST": { "message": "Automatic Daylight Savings Time" diff --git a/js/settings.js b/js/settings.js index 32af14bc..ae797f76 100644 --- a/js/settings.js +++ b/js/settings.js @@ -312,7 +312,7 @@ var Settings = (function () { 'mins' : 'Minutes', 'hours' : 'Hours', 'tzmins' : 'Minutes', - 'tzhours' : 'Hours:Mins' + 'tzhours' : 'Hours:Minutes', // Angles 'deg' : 'Degrees', 'decideg' : 'DeciDegrees', @@ -537,10 +537,11 @@ var Settings = (function () { } else if (multiplier === 'TZHOURS') { element.removeAttr('min'); element.removeAttr('max'); + element.attr('type', 'text'); element.attr('pattern', '[0-9]{2}:[0-9]{2}'); let hours = Math.floor(oldValue/60); let mins = oldValue - (hours*60); - newValue = hours + ':' + mins; + newValue = padZeros(hours, 2) + ':' + padZeros(mins, 2); } else { newValue = Number((oldValue / multiplier)).toFixed(decimalPlaces); } @@ -579,7 +580,7 @@ var Settings = (function () { value = Math.round(((parseFloat(input.val())-32) / 1.8) * 10); } else if (multiplier === 'TZHOURS') { let inputTZ = input.val().split(':'); - value = (inputTZ[0] * 60) + inputTZ[1]; + value = (parseInt(inputTZ[0]) * 60) + parseInt(inputTZ[1]); } else { multiplier = parseFloat(multiplier); diff --git a/main.js b/main.js index b365b96a..d27b0a07 100644 --- a/main.js +++ b/main.js @@ -649,6 +649,11 @@ String.prototype.format = function () { }); }; +function padZeros(val, length) { + let str = val.toString(); + return str.length < length ? padZeros("0" + str, length) : str; +}; + function updateActivatedTab() { var activeTab = $('#tabs > ul li.active'); activeTab.removeClass('active');