When using the office hours field in a paragraph and multiple paragraphs with office hours are opened, the additional time slots become visible in the previously opened paragraphs.
Steps to replicate:
* Create a content type that uses paragraphs
* Create a paragraph that uses office_hours field type
* Add new node
* Add a new paragraph with office hours
* Add another paragraph with office hours
* The first paragraphs has all the time slots visible, not just the completed ones.

Comments

mmrares created an issue. See original summary.

mmrares’s picture

StatusFileSize
new673 bytes
johnv’s picture

Status: Active » Needs review

Hmm, could you post a printscreen of the affected slots?
I am not sure if the change is correct in all cases.
Which Field formatter do you use?

johnv’s picture

Status: Needs review » Postponed (maintainer needs more info)
andrei.godea’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.14 KB

When having multiple exception periods, the values were stored in arrays so the validation was not working correctly and there were multiple empty slots displayed.

andrei.godea’s picture

StatusFileSize
new1.15 KB
arpadpalko’s picture

StatusFileSize
new1.47 KB

When having multiple exception periods, the values were stored in arrays so the validation was not working correctly and there were multiple empty slots displayed.

Also check if the values are not empty.

arpadpalko’s picture

arpadpalko’s picture

StatusFileSize
new1.38 KB
johnv’s picture

  • johnv committed ec3f521 on 8.x-1.x authored by palkoarpad
    Issue #3065611 by palkoarpad, andrei.godea, mmrares: Additional time...
johnv’s picture

Version: 8.x-1.x-dev » 8.x-1.2
Status: Needs review » Fixed

Thanks, the latest correction using 'time' hinted me to the correct code.
Please checkout the current dev-version, and confirm if the problem is solved.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

johnv’s picture

Title: Additional time slots visible when using office hours in paragraphs » Paragraphs & OH: Additional time slots visible when using office hours in paragraphs