Configurable opening hours on Calendar

I’m trying to make the opening hours view on fullcalendar configrable on a day by day basis, The code is as follows:

dmx-business-hours.d1="{startTime:_SSN.data._userInfo.open_hours.mon_open,endTime:_SSN.data._userInfo.open_hours.mon_close,daysOfWeek:[1]}" dmx-business-hours.d2="{startTime:'09:45',endTime:'16:00',daysOfWeek:[2]}">

the manually configured .d2 works, the values coming from my session don’t.

There are values in the session variables. What’s the binding format required here ?

Thanks all

@Teodor

I’ve added the single quotes as outlined but no joy.

dmx-business-hours.d3="{startTime:'\''+_SSN.data._userInfo.open_hours.mon_open+'\'',endTime:'16:00',daysOfWeek:[3]}"

What am I missing ?

Thanks

@Teodor ??

dmx-business-hours.d3="{startTime:'_SSN.data._userInfo.open_hours.mon_open',endTime:'16:00',daysOfWeek:[3]}"

NO GOOD either. What are you trying to tell me in your cryptic way ?

Hello @scalaris
All i am doing is editing your posts so that the code is properly formatted.

Please when posting code follow this:

and don’t just paste code in the post, as it’s not well readable and formatted.

Right. thanks
Any clues as to what I’m doing wrong ?

Maybe @patrick can be more of a help here.

Place some logging around it like

dmx-business-hours.d1="log({startTime:_SSN.data._userInfo.open_hours.mon_open,endTime:_SSN.data._userInfo.open_hours.mon_close,daysOfWeek:[1]})"

it should then log the parsed value in the console of devtools.

The values appear correct but the diary isn’t greyed out accordingly. It’s showing all day. If set manually, it’s fine.

@patrick Here’s a perfect example. Monday is set programattically, Tuesday is set manually. The open/closed hours don’t render when set programmatically

Where exactly is the data coming from, it looks like it was first undefined and then set with a delay. Perhaps the calendar has some issues with the data coming later, will do some testing for that.

The calendar entries come from a SQL query, no problems there, and the daily working hours from session variables - which all have values as can be seen. So it’s a case the calendar is not rendering working hours when defined programmatically - only when pre-set

Please test with this update: dmxCalendar.zip (3.7 KB)

That’s working now.

Thanks Patrick

This has been fixed in Wappler 4.7.2

This topic was automatically closed after 42 hours. New replies are no longer allowed.