forked from MapComplete/MapComplete
Fix bugs with the opening hours picker
This commit is contained in:
parent
09b7bfb9ca
commit
4d139b45e6
4 changed files with 12 additions and 34 deletions
20
test.ts
20
test.ts
|
@ -1,23 +1,9 @@
|
|||
//*
|
||||
import {VariableUiElement} from "./UI/Base/VariableUIElement";
|
||||
import OpeningHoursRange from "./UI/Input/OpeningHours/OpeningHoursRange";
|
||||
import {UIEventSource} from "./Logic/UIEventSource";
|
||||
import OpeningHoursPicker from "./UI/Input/OpeningHours/OpeningHoursPicker";
|
||||
import {OpeningHour} from "./Logic/OpeningHours";
|
||||
|
||||
let oh = new OpeningHoursPicker(new UIEventSource<OpeningHour[]>([]));
|
||||
oh.SetStyle("height:100vh;display:block;").AttachTo('maindiv');
|
||||
|
||||
oh.GetValue().addCallback(data => console.log(data))
|
||||
|
||||
new VariableUiElement(oh.GetValue().map(oh => {
|
||||
if(oh === undefined){
|
||||
return "<no value selected>";
|
||||
}
|
||||
return oh.weekdayStart + " " + oh.startHour + ":" + oh.startMinutes + " --> " +
|
||||
oh.weekdayEnd + " " + oh.endHour + ":" + oh.endMinutes
|
||||
})).AttachTo("extradiv");
|
||||
import opening_hours from "opening_hours";
|
||||
|
||||
const oh =new opening_hours("mo 09:00-17:00;Tu 09:00-17:00;We 09:00-17:00");
|
||||
console.log(oh)
|
||||
|
||||
/*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue