BEMADEV/Room-Management

Schedule Exclusions Do Not Save With Certain Browser Settings

Closed this issue · 1 comments

Please go through all the tasks below

  • Check this box only after you have successfully completed both the above tasks

Please provide a brief description of the problem. Please do not forget to attach the relevant screenshots from your side.

When a Google Chrome browser has (Canadian) English prioritized over (United States) English, schedule exclusions are not saved in reservation edits, and the Reservation Calendar does not correctly apply exclusions. This does not happen for all schedules/exclusions, only for those applied to Room Management Reservations.

Expected Behavior

Expected Behavior: Adding a schedule exclusion should result in the exclusion saving to the reservation schedule, and being visible if the reservation is edited again.
Chrome browser settings:
image
Correct Schedule Exclusion:
image
Reservation is correctly excluded from the Calendar:
image

Actual Behavior

Actual Behavior: If the (Canadian) English language option is prioritized in the Google Chrome (or other) browser settings, the schedule exclusions in Room Management do not save correctly.
Chrome browser settings:
image
Blank Exclusion field:
image
Reservation is still visible on the Calendar:
image

Steps to Reproduce

  • Go to 'chrome://settings/languages'
  • Click on 'Add Languages'
  • Scroll down and Select '(Canadian) English'
  • Click 'Add' button
  • Click 'More Actions' icon on (Canadian) English option
  • Select 'Move to Top'
  • Restart Browser
  • Go to a test Reservation in Room Management Plugin
  • Click 'Edit' to edit the test Reservation
  • Click 'Edit Schedule'
  • Click 'Add Date Range' in Exclusion category
  • Enter test values for Exclusion Start and End dates
  • Click 'OK' on Exclusion entry
  • Click 'OK' on Schedule Edit modal
  • Click 'Save' on Reservation Edit
  • Go back to edit Reservation and see that the exclusion was not saved.
  • Go to Reservation Calendar and verify that the exclusion does not exist.

Rock Version

v15.1

Plugin Version

2.3.7.14

Client Culture Setting

en-US

After testing, we were able to reproduce this issue in both v14 and 15, but also in stock Rock. It looks like the issue lies in canadian dates using dashes, which breaks these lines in Core: https://github.com/SparkDevNetwork/Rock/blob/develop/Rock/Web/UI/Controls/ScheduleBuilder.cs#L925-L926. I recommend submitting a bug report requesting that the code be updated to the following to solve the issue:

var dateRangeParts = dateRangeString.Split( new string[] { " - " }, StringSplitOptions.RemoveEmptyEntries );