Commit 81033f44 authored by Andrea Ida Malkah Klaura's avatar Andrea Ida Malkah Klaura
Browse files

FIX: account for seconds in prettyDate functions

parent 18b132f9
...@@ -323,7 +323,7 @@ export default { ...@@ -323,7 +323,7 @@ export default {
arr.push({ arr.push({
title: note, title: note,
starts: this.prettyDateTime(this.current.timeslots[i].start), starts: this.prettyDateTime(this.current.timeslots[i].start),
duration: this.prettyDuration(this.current.timeslots[i].start, this.current.timeslots[i].end) + 'min', duration: this.prettyDuration(this.current.timeslots[i].start, this.current.timeslots[i].end),
// TODO: find out how to insert images or iconffont icons into b-table rows // TODO: find out how to insert images or iconffont icons into b-table rows
// options: '<img src="../assets/16x16/emblem-system.png" alt="edit note" v-on:click="' + this.editTimeslotNote(this.current.timeslots[i].id) + '" />' // options: '<img src="../assets/16x16/emblem-system.png" alt="edit note" v-on:click="' + this.editTimeslotNote(this.current.timeslots[i].id) + '" />'
options: '<span class="timeslotEditLink" onclick="' + options: '<span class="timeslotEditLink" onclick="' +
......
...@@ -55,19 +55,19 @@ export default { ...@@ -55,19 +55,19 @@ export default {
dstring += leadingZero(d.getDate()) + '. ' dstring += leadingZero(d.getDate()) + '. '
dstring += month[d.getMonth()] + ' ' dstring += month[d.getMonth()] + ' '
dstring += d.getFullYear() + ', ' dstring += d.getFullYear() + ', '
dstring += leadingZero(d.getHours()) + ':' + leadingZero(d.getMinutes()) dstring += leadingZero(d.getHours()) + ':' + leadingZero(d.getMinutes()) + ':' + leadingZero(d.getSeconds())
return dstring return dstring
}, },
prettyDuration: function (start, end) { prettyDuration: function (start, end) {
var duration = (new Date(end).getTime() - new Date(start).getTime()) / 1000 var seconds = (new Date(end).getTime() - new Date(start).getTime()) / 1000
/* var minutes = Math.floor(seconds / 60)
// This is the old notation in HH:MM - have to decide which one to use in final design var duration = minutes + 'min'
var hours = Math.floor(duration / 60 / 60) if (minutes < seconds / 60) {
var minutes = (duration / 60) % 60 duration += ' '
return leadingZero(hours) + ':' + leadingZero(minutes) duration += seconds - 60 * minutes
*/ duration += 'sec'
// Here we just return the duration in minutes }
return duration / 60 return duration
} }
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment