Migrated from Redmine #424 | Author: Juan Villegas Status: New | Priority: High, I’m very impatient | Created: 2019-09-13
In our application we have two calendars, one where the User can mark their availability for each day of the week (not for a particular date, but rather specify their “opening” hours for Monday, tuesday, wednesday, etc), and another where they can choose specific dates they are not available and mark them as “day off”.
For the first calendar we are using setWorkDayInfo with breaktimes, etc, and it works perfectly well when the User hasn’t marked any dates as special.
If the user marks a date as special in the current week, and then tries to alter their weekly schedule using setWorkDayInfo, the API returns a success code but the change is not persisted. Even though we are not specifying a “date” in setWorkDayInfo, the API seems to ignore it because there is a “special” date in the current week.
My question is: has anyone experience this before?
And: is this expected behavior? Does setWorkDayInfo takes the current week as reference and ignores my changes if there are special dates in the current week?
In your example you were passed both event_id and unit_group_id which should never be done as we do not have schedule for service-provider pair. You need to pass event_id or provider_id but not both.
Hi, thanks for your answer. I appreciate it.
So let me try to explain myself again with a concrete example. The provider has marked days 16, 17, 18 and 19 of September as “special”, as she won’t be working those days. The provider now wants to edit her general hours of operation, so she issues the following request:
Returns true but doesn’t alter the Provider’s calendar if current week’s monday is marked as special. It’s as if the API wasn’t able to override that for some reason.
Return true and works as expected if current week’s monday is not marked as special.
The issue mentioned in my second message is regarding removing the “special” day tag from a particular date. Assuming DATE_X is a “special” date, then executing the following:
Hi, it seems there is some confusion about schedule priority.
Service/Provider special day schedule has highest priority and override week schedule. Company schedule has lowest priority.
E.g. if you have special day for provider and would set his weekly schedule on Monday it will not affect special day schedule because it do not change it.
If there is some special day settings then you need to alter it by passing exact day to this function
mm Yea, well, I kind of knew that. However, it should be possible to alter the general provider schedule even if there are some days marked as special in the current week right?
Let’s say the provider has marked next Friday as special, but also wants to set all Fridays operation hours to 2pm-4pm. It seems like that combination wouldn’t be possible with the API.
The only workaround for above example that I can think of with my (limited) knowledge of how this works is:
-test if the current week’s friday is special.
-if it is, unset the special day (using /deleteSpecialDay)
-change the schedule for all fridays
-set friday as special day again.
Hi, well, your workaround is actually correct way to solve this problem. This method should not clear special days if it was set, otherwise it may bring up some big-big problems.
No, but I think it should edit the schedule for days that aren’t marked as special. I’m actually a bit surprised no one stumbled with this before..
I’ll proceed with my solution even if it involves 4 api calls then.