diff options
author | Phil Hughes <me@iamphill.com> | 2017-05-30 10:34:15 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-05-30 10:34:15 +0100 |
commit | 3465e1e52c812a4a4f4fe941ab04569ebf2a2c12 (patch) | |
tree | 5e28219da36739e6c9abf7366105a6102dc47c5c /app/assets/javascripts/vue_shared/mixins | |
parent | 5227ea5bc483359bb8a9a40057587651ecb850c2 (diff) | |
parent | f47e86feaa91d4ba1b268c56dd0a488c7092b573 (diff) | |
download | gitlab-ce-3465e1e52c812a4a4f4fe941ab04569ebf2a2c12.tar.gz |
Merge branch 'master' into issue-edit-inline
Diffstat (limited to 'app/assets/javascripts/vue_shared/mixins')
-rw-r--r-- | app/assets/javascripts/vue_shared/mixins/timeago.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/mixins/timeago.js b/app/assets/javascripts/vue_shared/mixins/timeago.js new file mode 100644 index 00000000000..20f63ab663c --- /dev/null +++ b/app/assets/javascripts/vue_shared/mixins/timeago.js @@ -0,0 +1,18 @@ +import '../../lib/utils/datetime_utility'; + +/** + * Mixin with time ago methods used in some vue components + */ +export default { + methods: { + timeFormated(time) { + const timeago = gl.utils.getTimeago(); + + return timeago.format(time); + }, + + tooltipTitle(time) { + return gl.utils.formatDate(time); + }, + }, +}; |