mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-16 21:33:51 +02:00
Fix "24" hour time
This commit is contained in:
@@ -19032,7 +19032,7 @@ speechSynthesis.getVoices();
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
second: 'numeric',
|
||||
hour12
|
||||
hourCycle: (hour12 ? 'h12' : 'h23')
|
||||
});
|
||||
} else if (format === 'short') {
|
||||
return dt
|
||||
@@ -19041,7 +19041,7 @@ speechSynthesis.getVoices();
|
||||
day: '2-digit',
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
hour12
|
||||
hourCycle: (hour12 ? 'h12' : 'h23')
|
||||
})
|
||||
.replace(' AM', 'am')
|
||||
.replace(' PM', 'pm')
|
||||
|
||||
@@ -1016,7 +1016,7 @@ html
|
||||
div.options-container-item
|
||||
span.name Enable
|
||||
el-switch(v-model="openVR" @change="saveOpenVROption")
|
||||
div.options-container-item
|
||||
div.options-container-item(style="min-width:118px")
|
||||
span.name Start overlay with
|
||||
el-switch(v-model="openVRAlways" @change="saveOpenVROption" inactive-text="VRChat" active-text="SteamVR" :disabled="!openVR")
|
||||
div.options-container-item
|
||||
|
||||
@@ -46,30 +46,30 @@ Vue.component('marquee-text', MarqueeText);
|
||||
.join(' ');
|
||||
Vue.filter('textToHex', textToHex);
|
||||
|
||||
var timeToText = (t) => {
|
||||
var sec = Number(t);
|
||||
if (isNaN(sec)) {
|
||||
return escapeTag(t);
|
||||
var timeToText = function (sec) {
|
||||
var n = Number(sec);
|
||||
if (isNaN(n)) {
|
||||
return escapeTag(sec);
|
||||
}
|
||||
sec = Math.floor(sec / 1000);
|
||||
n = Math.floor(n / 1000);
|
||||
var arr = [];
|
||||
if (sec < 0) {
|
||||
sec = -sec;
|
||||
if (n < 0) {
|
||||
n = -n;
|
||||
}
|
||||
if (sec >= 86400) {
|
||||
arr.push(`${Math.floor(sec / 86400)}d`);
|
||||
sec %= 86400;
|
||||
if (n >= 86400) {
|
||||
arr.push(`${Math.floor(n / 86400)}d`);
|
||||
n %= 86400;
|
||||
}
|
||||
if (sec >= 3600) {
|
||||
arr.push(`${Math.floor(sec / 3600)}h`);
|
||||
sec %= 3600;
|
||||
if (n >= 3600) {
|
||||
arr.push(`${Math.floor(n / 3600)}h`);
|
||||
n %= 3600;
|
||||
}
|
||||
if (sec >= 60) {
|
||||
arr.push(`${Math.floor(sec / 60)}m`);
|
||||
sec %= 60;
|
||||
if (n >= 60) {
|
||||
arr.push(`${Math.floor(n / 60)}m`);
|
||||
n %= 60;
|
||||
}
|
||||
if (sec || !arr.length) {
|
||||
arr.push(`${sec}s`);
|
||||
if (arr.length === 0 && n < 60) {
|
||||
arr.push(`${n}s`);
|
||||
}
|
||||
return arr.join(' ');
|
||||
};
|
||||
@@ -327,7 +327,7 @@ Vue.component('marquee-text', MarqueeText);
|
||||
year: 'numeric',
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
hour12: this.config.dtHour12
|
||||
hourCycle: (this.config.dtHour12 ? 'h12' : 'h23')
|
||||
})
|
||||
.replace(' AM', ' am')
|
||||
.replace(' PM', ' pm')
|
||||
@@ -603,7 +603,7 @@ Vue.component('marquee-text', MarqueeText);
|
||||
.toLocaleTimeString($app.currentCulture, {
|
||||
hour: '2-digit',
|
||||
minute: 'numeric',
|
||||
hour12: $app.config.dtHour12
|
||||
hourCycle: ($app.config.dtHour12 ? 'h12' : 'h23')
|
||||
})
|
||||
.replace(' am', '')
|
||||
.replace(' pm', '');
|
||||
|
||||
Reference in New Issue
Block a user