From 10d560623d71569f6d8ebf4be94e72268116ed1f Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Mon, 27 May 2019 18:02:05 +0400 Subject: [PATCH] add moment --- build.gradle | 1 + src/main/resources/static/index.html | 1 + src/main/resources/static/papers/paper.vue | 75 +++++++++++++++++++--- 3 files changed, 67 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 5ad1f49..4c2ce50 100644 --- a/build.gradle +++ b/build.gradle @@ -122,6 +122,7 @@ dependencies { compile group: 'org.webjars.npm', name: 'vuex', version: '3.1.0' compile group: 'org.webjars.npm', name: 'vue-router', version: '3.0.2' compile group: 'org.webjars.npm', name: 'vue-multiselect', version: '2.0.2' + compile group: 'org.webjars.npm', name: 'vue-moment', version: '4.0.0' compile group: 'org.webjars.npm', name: 'http-vue-loader', version: '1.3.5' compile group: 'org.webjars.npm', name: 'axios', version: '0.18.0' diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index 4d3b388..4da84b9 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -24,6 +24,7 @@ + diff --git a/src/main/resources/static/papers/paper.vue b/src/main/resources/static/papers/paper.vue index 59fb3f2..0c816fc 100644 --- a/src/main/resources/static/papers/paper.vue +++ b/src/main/resources/static/papers/paper.vue @@ -28,38 +28,37 @@ aria-labelledby="nav-main-tab">
-
- +
- +
- +
- +
-
+
+
+
+
+
Дата создания:
+
+
+ + {{ formatDate(paper.createDate) }} + +
+
+
+
+
+
+
Дата изменения:
+
+
+ + {{ formatDate(paper.updateDate) }} + +
+
+
+
+ +
+
+ +
+
+
+ + + Отмена + +
+ +
+ @@ -87,12 +135,19 @@ }, data: function () { return { - paperAuthors:[], + paper:'', allAuthors: [], allTypes: [], allStatuses: [] }; }, + methods: { + formatDate: function (date) { + if (date) { + return moment(String(new Date(date))).format('DD.MM.YYYY hh:mm') + } + } + }, mounted: function () { var self = this; axiosEx.get(