From 3a1ae3a30e1418099a71cdc8ea92d5f360b0f65d Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 31 May 2017 12:45:03 +0300 Subject: [PATCH] Add a custom timeago.json for shorter timestamps, for example '15s' instead of '15 seconds ago' --- src/main.js | 2 +- static/timeago.json | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 static/timeago.json diff --git a/src/main.js b/src/main.js index 969ca8dc..35261578 100644 --- a/src/main.js +++ b/src/main.js @@ -24,7 +24,7 @@ Vue.use(VueRouter) Vue.use(VueTimeago, { locale: 'en-US', locales: { - 'en-US': require('vue-timeago/locales/en-US.json') + 'en-US': require('../static/timeago.json') } }) diff --git a/static/timeago.json b/static/timeago.json new file mode 100644 index 00000000..b6f669c2 --- /dev/null +++ b/static/timeago.json @@ -0,0 +1,10 @@ +[ + "now", + ["%ss", "%ss"], + ["%smin", "%smin"], + ["%sh", "%sh"], + ["%sd", "%sd"], + ["%sw", "%sw"], + ["%sm", "%sm"], + ["%sy", "%sy"] +]