diff --git a/view/vue/container/emergency.vue b/view/vue/container/emergency.vue index fd456f3..7094152 100644 --- a/view/vue/container/emergency.vue +++ b/view/vue/container/emergency.vue @@ -29,7 +29,6 @@ export default { local_date: function(id){ /* (1) Get current date */ var cur = new Date( gstore.data.notif.emergency.data[id].timestamp ); - console.log(cur); /* (2) First line -> show whole date */ if( id < 1 ) diff --git a/view/vue/container/event.vue b/view/vue/container/event.vue index 180aacc..f96b542 100644 --- a/view/vue/container/event.vue +++ b/view/vue/container/event.vue @@ -5,6 +5,7 @@
+
@@ -25,6 +26,23 @@ export default { name: 'CONTAINER_EVENT', data(){ return { gstore: gstore.data }; }, methods: { + local_date: function(id){ + /* (1) Get current date */ + var cur = new Date( gstore.data.notif.event.data[id].timestamp ); + + /* (2) First line -> show whole date */ + if( id < 1 ) + return cur.toLocaleString(); + + /* (3) Get previous date */ + var pre = new Date( gstore.data.notif.event.data[id-1].timestamp ); + + /* (2) If same day -> show time only */ + if( cur.toLocaleDateString() == pre.toLocaleDateString() ) + return cur.toLocaleTimeString(); + + return cur.toLocaleString(); + }, new_message(msg){ /* (1) If empty message -> abort */