diff --git a/client/pages/config/index.vue b/client/pages/config/index.vue index 3dda0a60..1b46046f 100644 --- a/client/pages/config/index.vue +++ b/client/pages/config/index.vue @@ -156,6 +156,15 @@

+ +
+ +

+ Date Format + info_outlined +

+
+
@@ -282,6 +291,9 @@ export default { set(val) { this.$store.commit('setExperimentalFeatures', val) } + }, + dateFormats() { + return this.$store.state.globals.dateFormats } }, methods: { diff --git a/client/pages/item/_id/index.vue b/client/pages/item/_id/index.vue index 8128b798..e0be6dad 100644 --- a/client/pages/item/_id/index.vue +++ b/client/pages/item/_id/index.vue @@ -118,9 +118,9 @@

Your Progress: {{ Math.round(progressPercent * 100) }}%

-

Finished {{ $formatDate(userProgressFinishedAt, 'MM/dd/yyyy') }}

+

Finished {{ $formatDate(userProgressFinishedAt, dateFormat) }}

{{ $elapsedPretty(userTimeRemaining) }} remaining

-

Started {{ $formatDate(userProgressStartedAt, 'MM/dd/yyyy') }}

+

Started {{ $formatDate(userProgressStartedAt, dateFormat) }}

close @@ -226,6 +226,9 @@ export default { } }, computed: { + dateFormat() { + return this.$store.state.serverSettings.dateFormat + }, showExperimentalFeatures() { return this.$store.state.showExperimentalFeatures }, diff --git a/client/plugins/init.client.js b/client/plugins/init.client.js index bdc1b2f5..4e39ef51 100644 --- a/client/plugins/init.client.js +++ b/client/plugins/init.client.js @@ -169,7 +169,7 @@ Vue.prototype.$sanitizeSlug = (str) => { str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)) } - str = str.replace('.', '-') // replace a dot by a dash + str = str.replace('.', '-') // replace a dot by a dash .replace(/[^a-z0-9 -_]/g, '') // remove invalid chars .replace(/\s+/g, '-') // collapse whitespace and replace by a dash .replace(/-+/g, '-') // collapse dashes diff --git a/client/store/globals.js b/client/store/globals.js index b02eb286..f1bb51f4 100644 --- a/client/store/globals.js +++ b/client/store/globals.js @@ -1,4 +1,3 @@ - export const state = () => ({ isMobile: false, isMobileLandscape: false, @@ -12,7 +11,21 @@ export const state = () => ({ selectedCollection: null, selectedAuthor: null, isCasting: false, // Actively casting - isChromecastInitialized: false // Script loaded + isChromecastInitialized: false, // Script loaded + dateFormats: [ + { + text: 'MM/DD/YYYY', + value: 'MM/dd/yyyy' + }, + { + text: 'DD/MM/YYYY', + value: 'dd/MM/yyyy' + }, + { + text: 'YYYY-MM-DD', + value: 'yyyy-MM-dd' + } + ] }) export const getters = { diff --git a/server/objects/settings/ServerSettings.js b/server/objects/settings/ServerSettings.js index 00c56b2a..5a83f330 100644 --- a/server/objects/settings/ServerSettings.js +++ b/server/objects/settings/ServerSettings.js @@ -12,7 +12,7 @@ class ServerSettings { this.scannerPreferAudioMetadata = false this.scannerPreferOpfMetadata = false this.scannerPreferMatchedMetadata = false - this.scannerDisableWatcher = false + this.scannerDisableWatcher = false this.scannerPreferOverdriveMediaMarker = false // Metadata - choose to store inside users library item folder @@ -48,6 +48,7 @@ class ServerSettings { // Misc Flags this.chromecastEnabled = false this.enableEReader = false + this.dateFormat="MM/dd/yyyy" this.logLevel = Logger.logLevel @@ -95,6 +96,7 @@ class ServerSettings { this.sortingPrefixes = settings.sortingPrefixes || ['the', 'a'] this.chromecastEnabled = !!settings.chromecastEnabled this.enableEReader = !!settings.enableEReader + this.dateFormat = settings.dateFormat this.logLevel = settings.logLevel || Logger.logLevel this.version = settings.version || null @@ -130,6 +132,7 @@ class ServerSettings { sortingPrefixes: [...this.sortingPrefixes], chromecastEnabled: this.chromecastEnabled, enableEReader: this.enableEReader, + dateFormat: this.dateFormat, logLevel: this.logLevel, version: this.version }