diff options
Diffstat (limited to 'src/models')
| -rw-r--r-- | src/models/EventInfo.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/models/EventInfo.ts b/src/models/EventInfo.ts index a6819db..693c8bb 100644 --- a/src/models/EventInfo.ts +++ b/src/models/EventInfo.ts @@ -57,4 +57,10 @@ export default class EventInfo { return `${this.days} ${EventInfo.timeToStr(this.start)}-${EventInfo.timeToStr(this.end)}`; } } + + get duration_mins() { + const diff_hours = Math.floor(this.end / 100) - Math.floor(this.start / 100); + const diff_mins = this.end % 100 - this.start % 100; + return (diff_hours * 60 + diff_mins) * this.days.length; + } }
\ No newline at end of file |
