The widget is now in. Feel free to test, comment and contribute!

Problem/Motivation

This is part of #3585605: Add support for *Calendar* Views displays
Currently, it is not possible to add each opening time to a Views Calendar display.

For this, the office hours must be exploded into multiple instances.
That is supported by the Recurring Dates Field.

The module date_recur is now supported in the Calendar module:
#2820803: Support Recurring Dates Field in Calendar 8.x-1.x
#3127308: Support Recurring Dates Field in Calendar 8.x-2.x

Steps to reproduce

Create node type with a field type supporting office_hours module (widget)
- add a node with office hours, add the following minimal timeslots:
-- each monday from 09:00-17:00 (regular week with 1 timeslot)
-- next tuesday from 11:00-12:00 (exception date with 2 timeslots)
-- next tuesday from 14:00-15:00 (exception date with 2 timeslots)
-- each friday the rest of the month from 09:00-17:00 (season week with 1 timeslot)
- create a calendar view, (add a relationship), add office_hours field (via relationship).
- display the view. Each time slot should appear on the correct day with the correct start/end time.

Proposed resolution

- It is tried to save office_hours data as date_recur 'Occurrences'. But there was too much code copying involved.
- Instead, the route has been selected to adapt the office_hour widget also for date_recur fields.

Remaining tasks

  • [ ✔ ] #3585605: Add support for *Calendar* Views displays
  • [ ✔ ] Create src/Plugin/DataType/OfficeHoursDateRecurItemList.php, an ItemList wrapper class and adaptor class for 2-way conversion between 'office_hours' and 'date_recur'
  • [   ] Fix features: timezone handling in widget saving
  • [   ] Fix features in widget settings: E.g., now not possible to leave end time empty; all_day is not tested
  • [   ] Fix features in widget settings: Add missing support for time slot comments and season title
  • [  WIP  ] Create src/EventSubscriber/DateRecurEventSubscriber.php, to override default DateRecur::onSave() event to respect exception date > season > regular week priority. NOTE. This is now disable with a one-line code, until a mechanism is in place to not unwillingly override current logic.
  • [   ] Adapt formatter
  • [   ] Fix CI errors in : Pipelines

Comments

johnv created an issue. See original summary.

  • johnv committed 743add24 on 8.x-1.x
    Issue #3584687: Make office_hours.js compatible with all field_types
    
johnv’s picture

Issue summary: View changes
johnv’s picture

Issue summary: View changes
johnv’s picture

Issue summary: View changes

  • johnv committed b8bf005e on 8.x-1.x
    Issue #3584687: Add widget support for date_recur field - beta
    
johnv’s picture

Issue summary: View changes

  • johnv committed 856fb824 on 8.x-1.x
    Issue #3584687: Add widget support for date_recur field - beta
    
johnv’s picture

Issue summary: View changes

The widget is now in. Feel free to test, comment and contribute!

  • johnv committed f7a10343 on 8.x-1.x
    Issue #3584687: Add horizon parameter to OfficeHoursItemListSorter
    

  • johnv committed 8e282ef6 on 8.x-1.x
    Issue #3584687: Add widget support for date_recur field - beta2
    
johnv’s picture

johnv’s picture

Issue summary: View changes

  • johnv committed 8e38481c on 8.x-1.x
    Issue #3584687: Rename OfficeHoursRecurItemList to ~DateRecurItemList
    
johnv’s picture

Issue summary: View changes

  • johnv committed 25f2df9f on 8.x-1.x
    Issue #3584687: Revert office_hours.js links
    
johnv’s picture

Issue summary: View changes

  • johnv committed fdf0f096 on 8.x-1.x
    Issue #3584687: Manage CI dependecny on date_recur module
    

  • johnv committed 01584fe8 on 8.x-1.x
    Issue #3584687: Revert office_hours.js links
    

  • johnv committed 37a2b120 on 8.x-1.x
    Issue #3584687: Revert office_hours.js links
    

  • johnv committed 8423f35f on 8.x-1.x
    Issue #3584687: Move into submodule office_hours_date_recur
    

  • johnv committed ed0fbefe on 8.x-1.x
    Issue #3584687: Move into submodule office_hours_date_recur
    

  • johnv committed 06dd28de on 8.x-1.x
    Issue #3584687: Move into submodule office_hours_date_recur
    

  • johnv committed 95e1b285 on 8.x-1.x
    Issue #3584687: Move into submodule office_hours_date_recur
    
johnv’s picture

Status: Active » Needs work

Sorry for the Lots of commits. I do not seem to get rid of the CI errors, now that I have committed the date_recur adapter.
I now created a submodule, which makes the functionality a bit more prominent and switchable, but that should not be necessary, all all objects being pluggable.

Any help is appreciated.

  • johnv committed bf383351 on 8.x-1.x
    Issue #3584687: Introduce OfficeHoursAdapterInterface