Better OH viz

This commit is contained in:
Pieter Vander Vennet 2021-01-05 03:33:41 +01:00
parent 7e5e84b2f1
commit 6557c51493
4 changed files with 14 additions and 15 deletions

View file

@ -196,6 +196,14 @@ export default class OpeningHoursVisualization extends UIElement {
// Closed!
const opensAtDate = oh.getNextChange();
if(opensAtDate === undefined){
const comm = oh.getComment();
if(comm !== undefined){
return new FixedUiElement(comm).SetClass("ohviz-closed").Render();
}
if(oh.getState()){
return Translations.t.general.opening_hours.open_24_7.SetClass("ohviz-closed").Render()
}
return Translations.t.general.opening_hours.closed_permanently.SetClass("ohviz-closed").Render()
}
const moment = `${opensAtDate.getDay()}/${opensAtDate.getMonth() + 1} ${OH.hhmm(opensAtDate.getHours(), opensAtDate.getMinutes())}`