diff --git a/html/src/app.js b/html/src/app.js index 47394f56..a4f925da 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -19076,9 +19076,11 @@ speechSynthesis.getVoices(); }; $app.data.dtHour12 = configRepository.getBool('VRCX_dtHour12'); + $app.data.dtIsoFormat = configRepository.getBool('VRCX_dtIsoFormat'); $app.methods.setDatetimeFormat = async function () { var currentCulture = await AppApi.CurrentCulture(); var hour12 = configRepository.getBool('VRCX_dtHour12'); + var isoFormat = configRepository.getBool('VRCX_dtIsoFormat'); if (typeof this.dtHour12 !== 'undefined') { if (hour12 !== this.dtHour12) { configRepository.setBool('VRCX_dtHour12', this.dtHour12); @@ -19086,6 +19088,12 @@ speechSynthesis.getVoices(); } var hour12 = this.dtHour12; } + if (typeof this.dtIsoFormat !== 'undefined') { + if (isoFormat !== this.dtIsoFormat) { + configRepository.setBool('VRCX_dtIsoFormat', this.dtIsoFormat); + } + var isoFormat = this.dtIsoFormat; + } var formatDate1 = function (date, format) { if (!date) { return '-'; @@ -19116,6 +19124,30 @@ speechSynthesis.getVoices(); } return '-'; }; + if (isoFormat) { + formatDate1 = function (date, format) { + if (!date) { + return '-'; + } + var dt = new Date(date); + if (format === 'long') { + return dt.toISOString(); + } else if (format === 'short') { + return dt + .toLocaleDateString('en-nz', { + month: '2-digit', + day: '2-digit', + hour: 'numeric', + minute: 'numeric', + hourCycle: hour12 ? 'h12' : 'h23' + }) + .replace(' AM', 'am') + .replace(' PM', 'pm') + .replace(',', ''); + } + return '-'; + }; + } Vue.filter('formatDate', formatDate1); }; $app.methods.setDatetimeFormat(); diff --git a/html/src/index.pug b/html/src/index.pug index b1663ba3..c414fec6 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -1184,6 +1184,9 @@ html div.options-container-item span.name Time Format el-switch(v-model="dtHour12" @change="setDatetimeFormat" inactive-text="24 Hour" active-text="12 Hour") + div.options-container-item + span.name Force ISO date format + el-switch(v-model="dtIsoFormat" @change="setDatetimeFormat") div.options-container span.sub-header Automatically Manage Cache When Closing VRChat div.options-container-item