mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix issue #5100
This commit is contained in:
parent
138b60c462
commit
dd7344d05d
@ -92,17 +92,33 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #cell(start_date)="data">
|
<template #cell(start_date)="data">
|
||||||
{{ formatDate(new Date(data.item.date.substring(0, 10)), $t('config.month_and_day_fns')) }}
|
{{
|
||||||
|
new Intl.DateTimeFormat(locale, {
|
||||||
|
year: 'numeric',
|
||||||
|
month: 'long',
|
||||||
|
day: 'numeric'
|
||||||
|
}).format(new Date(data.item.date.substring(0, 10)))
|
||||||
|
}}
|
||||||
</template>
|
</template>
|
||||||
<template #cell(end_date)="data">
|
<template #cell(end_date)="data">
|
||||||
<span v-if="null !== data.item.end_date">{{
|
<span v-if="null !== data.item.end_date">
|
||||||
formatDate(new Date(data.item.end_date.substring(0, 10)), $t('config.month_and_day_fns'))
|
{{
|
||||||
}}</span>
|
new Intl.DateTimeFormat(locale, {
|
||||||
|
year: 'numeric',
|
||||||
|
month: 'long',
|
||||||
|
day: 'numeric'
|
||||||
|
}).format(new Date(data.item.end_date.substring(0, 10)))
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
<span v-if="null === data.item.end_date">{{ $t('firefly.forever') }}</span>
|
<span v-if="null === data.item.end_date">{{ $t('firefly.forever') }}</span>
|
||||||
<span v-if="null !== data.item.extension_date"><br/>
|
<span v-if="null !== data.item.extension_date"><br/>
|
||||||
<small>
|
<small>
|
||||||
{{
|
{{
|
||||||
$t('firefly.extension_date_is', {date: formatDate(new Date(data.item.extension_date.substring(0, 10)), $t('config.month_and_day_fns'))})
|
$t('firefly.extension_date_is', {date: new Intl.DateTimeFormat(locale, {
|
||||||
|
year: 'numeric',
|
||||||
|
month: 'long',
|
||||||
|
day: 'numeric'
|
||||||
|
}).format(new Date(data.item.extension_date.substring(0, 10)))})
|
||||||
}}
|
}}
|
||||||
</small>
|
</small>
|
||||||
</span>
|
</span>
|
||||||
@ -179,6 +195,7 @@ import {mapGetters, mapMutations} from "vuex";
|
|||||||
import {configureAxios} from "../../shared/forageStore";
|
import {configureAxios} from "../../shared/forageStore";
|
||||||
import format from "date-fns/format";
|
import format from "date-fns/format";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Index",
|
name: "Index",
|
||||||
data() {
|
data() {
|
||||||
@ -189,6 +206,7 @@ export default {
|
|||||||
locale: 'en-US',
|
locale: 'en-US',
|
||||||
sortedGroups: [],
|
sortedGroups: [],
|
||||||
fields: [],
|
fields: [],
|
||||||
|
fnsLocale: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -196,13 +214,15 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.locale = localStorage.locale ?? 'en-US';
|
this.locale = localStorage.locale ?? 'en-US';
|
||||||
|
console.log(this.locale);
|
||||||
|
|
||||||
this.updateFieldList();
|
this.updateFieldList();
|
||||||
this.downloadBills(1);
|
this.downloadBills(1);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations('root', ['refreshCacheKey',]),
|
...mapMutations('root', ['refreshCacheKey',]),
|
||||||
formatDate: function (date, frm) {
|
formatDate: function (date, frm) {
|
||||||
return format(date, frm);
|
return format(date, frm, {locale: {code: this.locale}});
|
||||||
},
|
},
|
||||||
updateFieldList: function () {
|
updateFieldList: function () {
|
||||||
this.fields = [];
|
this.fields = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user