mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 06:43:51 +02:00
Force ISO date format option
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user