]>
Commit | Line | Data |
---|---|---|
1 | import Vue from 'vue'; | |
2 | ||
3 | const internals = {}; | |
4 | ||
5 | export 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 |