BEMADEV / Room-Management

2 stars 2 forks source link

Schedule Exclusions Do Not Save With Certain Browser Settings #14

Closed bezalelBU closed 1 year ago

bezalelBU commented 1 year ago

Please go through all the tasks below

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

Rock Version

v15.1

Plugin Version

2.3.7.14

Client Culture Setting

en-US

tcavaletto commented 1 year ago

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 );