]> git.r.bdr.sh - rbdr/dasein/blob - app/filters/usertime.js
🔧 Update version in package.json
[rbdr/dasein] / app / filters / usertime.js
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