mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
first step towards localized meal date
This commit is contained in:
parent
d986190a55
commit
b9982c07f8
3 changed files with 23 additions and 4 deletions
|
@ -17,7 +17,7 @@
|
|||
:src="getImage(meal.slug)"
|
||||
@click="openSearch(index)"
|
||||
></v-img>
|
||||
<v-card-title class="my-n3 mb-n6">{{ meal.dateText }}</v-card-title>
|
||||
<v-card-title class="my-n3 mb-n6">{{ $d( new Date(meal.date), 'short' ) }}</v-card-title>
|
||||
<v-card-subtitle> {{ meal.name }}</v-card-subtitle>
|
||||
</v-card>
|
||||
</v-hover>
|
||||
|
|
|
@ -20,8 +20,27 @@ function loadLocaleMessages() {
|
|||
return messages;
|
||||
}
|
||||
|
||||
const dateTimeFormats = {
|
||||
'en': {
|
||||
short: {
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
weekday: 'long'
|
||||
},
|
||||
},
|
||||
'fr': {
|
||||
short: {
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
weekday: 'long'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default new VueI18n({
|
||||
locale: "en",
|
||||
fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || "en",
|
||||
messages: loadLocaleMessages(),
|
||||
dateTimeFormats
|
||||
});
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
>
|
||||
<v-card class="mt-1">
|
||||
<v-card-title>
|
||||
{{ formatDate(mealplan.startDate) }} -
|
||||
{{ formatDate(mealplan.endDate) }}
|
||||
{{ $d( new Date(mealplan.startDate), 'short' ) }} -
|
||||
{{ $d( new Date(mealplan.endDate), 'short' ) }}
|
||||
</v-card-title>
|
||||
<v-list nav>
|
||||
<v-list-item-group color="primary">
|
||||
|
@ -43,7 +43,7 @@
|
|||
</v-list-item-avatar>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title v-text="meal.name"></v-list-item-title>
|
||||
<v-list-item-subtitle v-text="meal.dateText">
|
||||
<v-list-item-subtitle v-text="$d( new Date(meal.date), 'short' )" >
|
||||
</v-list-item-subtitle>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue