From 5ae24298ae4d6414039c9151f7a801f6220b6ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Viricel?= Date: Sun, 6 Dec 2020 17:50:56 +0100 Subject: [PATCH] Add vue-moment 3rd party for date/time formating --- package.json | 1 + src/main.js | 2 ++ src/views/Fruit.vue | 3 ++- yarn.lock | 12 ++++++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index deb66c2..0073533 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "core-js": "^3.6.5", "fruit-api": "^1.1.3", "vue": "^2.6.11", + "vue-moment": "^4.1.0", "vue-router": "^3.2.0", "vuex": "^3.4.0" }, diff --git a/src/main.js b/src/main.js index 1505f06..db3ad5f 100644 --- a/src/main.js +++ b/src/main.js @@ -4,6 +4,8 @@ import App from "./App.vue"; import router from "./router"; import store from "./store"; +Vue.use(require("vue-moment")); + Vue.config.productionTip = false; new Vue({ diff --git a/src/views/Fruit.vue b/src/views/Fruit.vue index c92cbc8..4b31283 100644 --- a/src/views/Fruit.vue +++ b/src/views/Fruit.vue @@ -14,7 +14,7 @@

{{ "$" + fruit.price }}

- {{ fruit.expires }} + {{ "expires" }} {{ fruit.expires | moment("from", "now") }} @@ -22,6 +22,7 @@