Use app locale with toLocaleString/toLocaleDateString

Fixes inconsistent date formatting when browser language is different
from PleromaFE language.
This commit is contained in:
rinpatch 2020-12-03 00:17:55 +03:00
parent 0358284ebf
commit 60a8a89f5b
3 changed files with 9 additions and 4 deletions

View file

@ -1,6 +1,7 @@
import ProgressButton from 'src/components/progress_button/progress_button.vue'
import Checkbox from 'src/components/checkbox/checkbox.vue'
import Mfa from './mfa.vue'
import localeService from 'src/services/locale/locale.service.js'
const SecurityTab = {
data () {
@ -37,7 +38,7 @@ const SecurityTab = {
return {
id: oauthToken.id,
appName: oauthToken.app_name,
validUntil: new Date(oauthToken.valid_until).toLocaleDateString()
validUntil: new Date(oauthToken.valid_until).toLocaleDateString(localeService.internalToBrowserLocale(this.$i18n.locale))
}
})
}