mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-25 01:05:12 +03:00
Working
This commit is contained in:
parent
57ac8a103c
commit
43b69d434a
3 changed files with 10 additions and 4 deletions
|
@ -1017,7 +1017,7 @@
|
||||||
"message": "Timezone Offset"
|
"message": "Timezone Offset"
|
||||||
},
|
},
|
||||||
"tzOffsetHelp": {
|
"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": {
|
"tzAutomaticDST": {
|
||||||
"message": "Automatic Daylight Savings Time"
|
"message": "Automatic Daylight Savings Time"
|
||||||
|
|
|
@ -312,7 +312,7 @@ var Settings = (function () {
|
||||||
'mins' : 'Minutes',
|
'mins' : 'Minutes',
|
||||||
'hours' : 'Hours',
|
'hours' : 'Hours',
|
||||||
'tzmins' : 'Minutes',
|
'tzmins' : 'Minutes',
|
||||||
'tzhours' : 'Hours:Mins'
|
'tzhours' : 'Hours:Minutes',
|
||||||
// Angles
|
// Angles
|
||||||
'deg' : 'Degrees',
|
'deg' : 'Degrees',
|
||||||
'decideg' : 'DeciDegrees',
|
'decideg' : 'DeciDegrees',
|
||||||
|
@ -537,10 +537,11 @@ var Settings = (function () {
|
||||||
} else if (multiplier === 'TZHOURS') {
|
} else if (multiplier === 'TZHOURS') {
|
||||||
element.removeAttr('min');
|
element.removeAttr('min');
|
||||||
element.removeAttr('max');
|
element.removeAttr('max');
|
||||||
|
element.attr('type', 'text');
|
||||||
element.attr('pattern', '[0-9]{2}:[0-9]{2}');
|
element.attr('pattern', '[0-9]{2}:[0-9]{2}');
|
||||||
let hours = Math.floor(oldValue/60);
|
let hours = Math.floor(oldValue/60);
|
||||||
let mins = oldValue - (hours*60);
|
let mins = oldValue - (hours*60);
|
||||||
newValue = hours + ':' + mins;
|
newValue = padZeros(hours, 2) + ':' + padZeros(mins, 2);
|
||||||
} else {
|
} else {
|
||||||
newValue = Number((oldValue / multiplier)).toFixed(decimalPlaces);
|
newValue = Number((oldValue / multiplier)).toFixed(decimalPlaces);
|
||||||
}
|
}
|
||||||
|
@ -579,7 +580,7 @@ var Settings = (function () {
|
||||||
value = Math.round(((parseFloat(input.val())-32) / 1.8) * 10);
|
value = Math.round(((parseFloat(input.val())-32) / 1.8) * 10);
|
||||||
} else if (multiplier === 'TZHOURS') {
|
} else if (multiplier === 'TZHOURS') {
|
||||||
let inputTZ = input.val().split(':');
|
let inputTZ = input.val().split(':');
|
||||||
value = (inputTZ[0] * 60) + inputTZ[1];
|
value = (parseInt(inputTZ[0]) * 60) + parseInt(inputTZ[1]);
|
||||||
} else {
|
} else {
|
||||||
multiplier = parseFloat(multiplier);
|
multiplier = parseFloat(multiplier);
|
||||||
|
|
||||||
|
|
5
main.js
5
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() {
|
function updateActivatedTab() {
|
||||||
var activeTab = $('#tabs > ul li.active');
|
var activeTab = $('#tabs > ul li.active');
|
||||||
activeTab.removeClass('active');
|
activeTab.removeClass('active');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue