{{ backup.name }}
-
{{ readableTime(backup.date) }}
+
{{ $d(new Date(backup.date), "medium") }}
@@ -40,7 +40,6 @@
diff --git a/frontend/src/pages/MealPlan/Planner.vue b/frontend/src/pages/MealPlan/Planner.vue
index 2d472216d244..72add28bda4c 100644
--- a/frontend/src/pages/MealPlan/Planner.vue
+++ b/frontend/src/pages/MealPlan/Planner.vue
@@ -112,10 +112,6 @@ export default {
generateKey(name, index) {
return utils.generateUniqueKey(name, index);
},
- formatDate(timestamp) {
- let dateObject = new Date(timestamp);
- return utils.getDateAsTextAlt(dateObject);
- },
getImage(image) {
return api.recipes.recipeTinyImage(image);
},
diff --git a/frontend/src/routes/admin.js b/frontend/src/routes/admin.js
index b6c47cfd8678..5b51907f044c 100644
--- a/frontend/src/routes/admin.js
+++ b/frontend/src/routes/admin.js
@@ -8,7 +8,6 @@ import ManageUsers from "@/pages/Admin/ManageUsers";
import Settings from "@/pages/Admin/Settings";
import About from "@/pages/Admin/About";
import { store } from "../store";
-import i18n from '@/i18n.js';
export const adminRoutes = {
path: "/admin",
@@ -27,7 +26,7 @@ export const adminRoutes = {
path: "profile",
component: Profile,
meta: {
- title: i18n.t('settings.profile'),
+ title: "settings.profile",
},
},
@@ -35,49 +34,49 @@ export const adminRoutes = {
path: "backups",
component: Backup,
meta: {
- title: i18n.t('settings.backup-and-exports'),
+ title: "settings.backup-and-exports",
},
},
{
path: "themes",
component: Theme,
meta: {
- title: i18n.t('general.themes'),
+ title: "general.themes",
},
},
{
path: "meal-planner",
component: MealPlanner,
meta: {
- title: i18n.t('meal-plan.meal-planner'),
+ title: "meal-plan.meal-planner",
},
},
{
path: "migrations",
component: Migration,
meta: {
- title: i18n.t('settings.migrations'),
+ title: "settings.migrations",
},
},
{
path: "manage-users",
component: ManageUsers,
meta: {
- title: i18n.t('settings.manage-users'),
+ title: "settings.manage-users",
},
},
{
path: "settings",
component: Settings,
meta: {
- title: i18n.t('settings.site-settings'),
+ title: "settings.site-settings",
},
},
{
path: "about",
component: About,
meta: {
- title: i18n.t('general.about'),
+ title: "general.about",
},
},
],
diff --git a/frontend/src/routes/general.js b/frontend/src/routes/general.js
index 14ab2f9d8292..5a6ffe515035 100644
--- a/frontend/src/routes/general.js
+++ b/frontend/src/routes/general.js
@@ -1,4 +1,3 @@
-import i18n from "@/i18n.js";
import SearchPage from "@/pages/SearchPage";
import HomePage from "@/pages/HomePage";
@@ -9,7 +8,7 @@ export const generalRoutes = [
path: "/search",
component: SearchPage,
meta: {
- title: i18n.t("search.search"),
+ title: "search.search",
},
},
];
diff --git a/frontend/src/routes/index.js b/frontend/src/routes/index.js
index f53944182b68..1ff916bda81d 100644
--- a/frontend/src/routes/index.js
+++ b/frontend/src/routes/index.js
@@ -9,6 +9,7 @@ import VueRouter from "vue-router";
import VueI18n from "@/i18n";
import Vuetify from "@/plugins/vuetify";
import Vue from "vue";
+import i18n from '@/i18n.js';
export const routes = [
...generalRoutes,
@@ -34,8 +35,8 @@ router.afterEach(to => {
const title = await to.meta.title(to);
document.title = title + TITLE_SUFFIX;
} else {
- document.title = to.meta.title
- ? to.meta.title + TITLE_SUFFIX
+ document.title = i18n.t(to.meta.title)
+ ? i18n.t(to.meta.title) + TITLE_SUFFIX
: DEFAULT_TITLE;
}
});
diff --git a/frontend/src/routes/meal.js b/frontend/src/routes/meal.js
index 8d7954d74385..83d8ffc50ceb 100644
--- a/frontend/src/routes/meal.js
+++ b/frontend/src/routes/meal.js
@@ -1,6 +1,5 @@
import Planner from "@/pages/MealPlan/Planner";
import ThisWeek from "@/pages/MealPlan/ThisWeek";
-import i18n from "@/i18n.js";
import { api } from "@/api";
export const mealRoutes = [
@@ -8,14 +7,14 @@ export const mealRoutes = [
path: "/meal-plan/planner",
component: Planner,
meta: {
- title: i18n.t("meal-plan.meal-planner"),
+ title: "meal-plan.meal-planner",
},
},
{
path: "/meal-plan/this-week",
component: ThisWeek,
meta: {
- title: i18n.t("meal-plan.dinner-this-week"),
+ title: "meal-plan.dinner-this-week",
},
},
{
diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js
index e292d90624b4..d1f5afe7aeea 100644
--- a/frontend/src/utils/index.js
+++ b/frontend/src/utils/index.js
@@ -9,45 +9,6 @@ const notifyHelpers = {
info: "notify-info-color",
};
-const days = [
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday",
-];
-const months = [
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December",
-];
-
-const monthsShort = [
- "Jan",
- "Feb",
- "March",
- "April",
- "May",
- "June",
- "July",
- "Aug",
- "Sept",
- "Oct",
- "Nov",
- "Dec",
-];
-
export default {
getImageURL(image) {
return `/api/recipes/${image}/image?image_type=small`;
@@ -56,22 +17,6 @@ export default {
const uniqueKey = `${item}-${index}`;
return uniqueKey;
},
- getDateAsText(dateObject) {
- const dow = days[dateObject.getUTCDay()];
- const month = months[dateObject.getUTCMonth()];
- const day = dateObject.getUTCDate();
- // const year = dateObject.getFullYear();
-
- return `${dow}, ${month} ${day}`;
- },
- getDateAsTextAlt(dateObject) {
- const dow = days[dateObject.getUTCDay()];
- const month = monthsShort[dateObject.getUTCMonth()];
- const day = dateObject.getUTCDate();
- // const year = dateObject.getFullYear();
-
- return `${dow}, ${month} ${day}`;
- },
getDateAsPythonDate(dateObject) {
const month = dateObject.getUTCMonth() + 1;
const day = dateObject.getUTCDate();