A roll back to version 1.21 was able to stabilize the issue and made it work as intended.
- π³π±Netherlands johnv
Please specify all your Field 'Manage display' settings.
I tested with latest dev version (I was about to release this as new release, but will wait for your response) :
- Number of days to show = Show all days
- First day of week = - system's Regional settings - = Sunday
- Group consecutive days with same hours into one set = YESThis gives the following results:
Sun: Closed
Mon - Fri: 8:30-4:30
Sat: ClosedWhen changing First day of week to Tuesday, i get the following results.
Mon - Fri: 8:30-4:30
Sat - Sun: ClosedSo, I cannot reproduce. Which version are/were you using?
- π³π±Netherlands johnv
Please check new release 1.25 (to be released within hours)
- πΈπͺSweden ghaya
Hi,
I am getting the exact same error using the weekly view with the version 8.126 of Office Hours. The output on my site looks identical to the original posters with the hours appearing twice, separated by a comma.
- π³π±Netherlands johnv
Are your hours through midnight?
And if you press 'Add time slot' on the Monday, the second slot is not hidden there? - π³π±Netherlands johnv
Please specify all settings for 'Manage display' of the field (only the ones that are directly visible - no matter the ones hidden in a field set).
Where do you specify the 'first day of week'? in the field, or in 'Regional settings'? - πΈπͺSweden ghaya
1. Our hours do not go over midnight
2. when I add additional hours for a day, the extra timespan is shown and replaces the duplicate time for the day. So it becomes correct output if we add the second time range for the day.
It has worked as expected earlier, this problem has just come up with a recent update of the module and/or drupal core.
These are our settings for the weekly view where the problem occurs:
Number of days to show: Show All Days
First day of week: Systems regional settings
Day Notation: 3-letter weekday abbreviation
Time Notation: 24 hour time
Gorup consecutive days into one set (checked)
- πΈπͺSweden ghaya
To specify the problem in our case, the problem occurs when we "group consecutive days", the first day in the series is listen separately from the rest and hours are presented twice for that day. If I take away the group consecutive days option, the hours are shown correctly.
- πΊπΈUnited States artis
I'm seeing the same issue. Turning off the "group consective days" only works if the first day of the week is also set to Sunday. If it's Monday then the day prior to the first "closed" day will also show as "closed". It's very strange behavior that we've spent many hours trying to work around.
- πΊπΈUnited States artis
Correction: setting the starting day of the week has no impact.
But enabling "Replace weekday time slots with exception dates" fixed it for me. Seems like the Seasons output is correct but the regular output is not. The days immediately proceeding and following the empty hour days have issues with how they display.
- π³π±Netherlands johnv
Thanks fot your detailed reply.
I still cannot reproduce.have you Upgrade to v1. 26? - πΊπΈUnited States artis
Yes I upgraded.
I set up this staging so you can see what's happening: https://goodwill.txcsites.com/locations?location_type=donation
I've noticed that the location that the hours that match the location_type parameter from the url are the ones that are in error. If you change the filter to a different type then the error follows to that type.
- π³π±Netherlands johnv
OK, thanks, now i understand.
It was not clear to me that the problem happens in a Views display.
The hours are displayed correctly n a node list, but not in a Views Display. Strange... - π³π±Netherlands johnv
@artis, That is a nice page, BTW.
In my dev environment, I can only reproduce the error if the View does not only contains the normal 'Office Hours' formatter, but also the 'timeslot' field. There is no problem when adding the 'status' field, en did not test the 'season' field, yet. Probably, adding the normal formatter twice would generate the problem, too.
I did find how it happens, but am not sure yet why, or how to avoid it - working on that.Your view does not have the 'timeslot' added. Do you have multiple office_hours fields in a resutl row?
- πΊπΈUnited States artis
Thanks @johnv!
Yes we have multiple office_hours fields in a single results row in the view.
The view is outputting the 'location' content type which has a paragraph containing the office hours field. We're allowing the view to output the rendered formatter for the paragraph which is rendering the "rendered entity" formatter of the paragraph.
If it would be helpful I could provide you with credentials to access the view on the staging link I sent. You can find me in Drupal Slack under @artis
- π³π±Netherlands johnv
No need for access, thank you.
The above should fix the problem.
The 'groupDays' messes around with the items. Not sure yet how that influences the other formatters, but moving the cloning of the items does the trick. Please check new version. I will release a stable release soon.