]> git.r.bdr.sh - rbdr/dasein/blame - app/filters/usertime.js
Merge branch 'release/1.0.0'
[rbdr/dasein] / app / filters / usertime.js
CommitLineData
a6ccda0f
RBR
1import Vue from 'vue';
2
3const internals = {};
4
5export default internals.UsertimeFilter = Vue.filter('usertime', (timestamp) => {
6
7 const date = new Date(parseInt(timestamp));
8
9 const dateString = date.toISOString();
10
11 const dateComponents = dateString.split('T');
12 const dateFragment = dateComponents[0];
13 const timeComponents = dateComponents[1].split(':');
14
15 const hourFragment = timeComponents[0];
16 const minuteFragment = timeComponents[1];
17
18 return `${dateFragment} ${hourFragment}:${minuteFragment}`;
19});
20