1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-25 01:05:12 +03:00
This commit is contained in:
Darren Lines 2022-10-17 18:56:33 +01:00
parent 57ac8a103c
commit 43b69d434a
3 changed files with 10 additions and 4 deletions

View file

@ -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"

View file

@ -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);

View file

@ -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');