From 45f43d613fc78763bced684e4836f77405a00bf1 Mon Sep 17 00:00:00 2001 From: Kristian Polso Date: Sat, 12 May 2018 13:18:55 +0300 Subject: [PATCH] Github feed time format --- .vuepress/components/GithubFeed.vue | 10 +++++++++- .vuepress/theme/Layout.vue | 2 ++ package.json | 1 + yarn.lock | 8 +++++++- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.vuepress/components/GithubFeed.vue b/.vuepress/components/GithubFeed.vue index 1466b28..d9ebdf4 100644 --- a/.vuepress/components/GithubFeed.vue +++ b/.vuepress/components/GithubFeed.vue @@ -21,7 +21,7 @@ forked {{ event.repo.name }} to {{ event.payload.forkee.name }} in {{ event.repo.name }} +
{{ event.created_at | moment('from') }}
@@ -107,6 +108,13 @@ export default { vertical-align: middle; margin-right: 0.5rem; } + .time-ago { + color: #777; + font-style: italic; + font-size: 0.7rem; + float: right; + padding: 0.7rem 0 0 0; + } } \ No newline at end of file diff --git a/.vuepress/theme/Layout.vue b/.vuepress/theme/Layout.vue index c1b501b..ac1beb8 100644 --- a/.vuepress/theme/Layout.vue +++ b/.vuepress/theme/Layout.vue @@ -157,8 +157,10 @@ import Vue from 'vue' import VueResource from 'vue-resource' +import VueMoment from 'vue-moment' Vue.use(VueResource) +Vue.use(VueMoment) export default { data () { diff --git a/package.json b/package.json index 5993e7e..db95d61 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "vue-highlightjs": "^1.3.3", "vue-image-upload-resize": "^1.1.6", "vue-images-loaded": "^1.1.2", + "vue-moment": "^3.2.0", "vue-resource": "^1.5.0", "vuepress": "^0.8.3" } diff --git a/yarn.lock b/yarn.lock index 529f71e..9255838 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3492,7 +3492,7 @@ moment-timezone@^0.5.x: dependencies: moment ">= 2.9.0" -"moment@>= 2.9.0": +"moment@>= 2.9.0", moment@^2.11.1: version "2.22.1" resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.1.tgz#529a2e9bf973f259c9643d237fda84de3a26e8ad" @@ -5852,6 +5852,12 @@ vue-loader@^15.0.0-rc.1: vue-hot-reload-api "^2.3.0" vue-style-loader "^4.1.0" +vue-moment@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/vue-moment/-/vue-moment-3.2.0.tgz#28cd2b313831ae83953f646ac4785a2cc724e412" + dependencies: + moment "^2.11.1" + vue-resource@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/vue-resource/-/vue-resource-1.5.0.tgz#ba0c6ef7af2eeace03cf24a91f529471be974c72"