Github feed time format

This commit is contained in:
Kristian Polso 2018-05-12 13:18:55 +03:00
parent 9b6fdbe08a
commit 45f43d613f
4 changed files with 19 additions and 2 deletions

View file

@ -21,7 +21,7 @@
forked <a v-bind:href="event.repo.url" target="_blank">{{ event.repo.name }}</a> to <a v-bind:href="event.payload.forkee.url" target="_blank">{{ event.payload.forkee.name }}</a>
</template>
<template v-else-if="event.type == 'IssueCommentEvent'">
commented on <template v-if="event.payload.issue.pull_request">pull request</template><template v-else>issue</template> <a v-bind:href="event.payload.issue.url" target="_blank">{{ event.payload.issue.title }}</a>
commented on <template v-if="event.payload.issue.pull_request">pull request</template><template v-else>issue</template>&nbsp;<a v-bind:href="event.payload.issue.url" target="_blank">{{ event.payload.issue.title }}</a>
</template>
<template v-else-if="event.type == 'IssuesEvent'">
{{ event.payload.action }} issue <a v-bind:href="event.payload.issue.url" target="_blank">{{ event.payload.issue.title }}</a>
@ -39,6 +39,7 @@
starred the repo
</template>
in <a v-bind:href="event.repo.url" target="_blank">{{ event.repo.name }}</a>
<div class="time-ago">{{ event.created_at | moment('from') }}</div>
</div>
</div>
@ -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;
}
}
</style>

View file

@ -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 () {

View file

@ -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"
}

View file

@ -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"