mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-08 21:14:47 +02:00
Fix:Setting device language code
This commit is contained in:
parent
c7678da664
commit
e3aa96cbd5
2 changed files with 24 additions and 12 deletions
|
@ -5,8 +5,9 @@ import { Dialog } from '@capacitor/dialog'
|
|||
import { AbsFileSystem } from '@/plugins/capacitor'
|
||||
import { StatusBar, Style } from '@capacitor/status-bar'
|
||||
import { Clipboard } from '@capacitor/clipboard'
|
||||
import { formatDistance, format, addDays, isDate } from 'date-fns'
|
||||
import { Capacitor } from '@capacitor/core'
|
||||
import { formatDistance, format, addDays, isDate, setDefaultOptions } from 'date-fns'
|
||||
import * as locale from 'date-fns/locale'
|
||||
|
||||
Vue.directive('click-outside', vClickOutside.directive)
|
||||
|
||||
|
@ -38,6 +39,11 @@ Vue.prototype.$getAndroidSDKVersion = async () => {
|
|||
Vue.prototype.$encodeUriPath = (path) => {
|
||||
return path.replace(/\\/g, '/').replace(/%/g, '%25').replace(/#/g, '%23')
|
||||
}
|
||||
|
||||
Vue.prototype.$setDateFnsLocale = (localeString) => {
|
||||
if (!locale[localeString]) return 0
|
||||
return setDefaultOptions({ locale: locale[localeString] })
|
||||
}
|
||||
Vue.prototype.$dateDistanceFromNow = (unixms) => {
|
||||
if (!unixms) return ''
|
||||
return formatDistance(unixms, Date.now(), { addSuffix: true })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue