Some date fields not respecting culture setting (reversion since 16.2)
Description
Something has reverted in v16.3 onwards around date formatting. Date formats and date picker are not respecting culture settings. v 16.2 used on the demo site behaves correctly.
Version 16.5 16.5 (1.16.5.4), Client Culture Setting: en-NZ, Browser settings Language = English (New Zealand). Data and culture settings on PC, browser, and server are all set to en-NZ. No changes since previously successful versions of Rock.
For en-NZ dates should be in dd/MM/yyyy format, but in the Communication History pages dates are mixed, sometimes shown as MM/dd/yyyy, sometimes as dd/MM/yyyy.
View Communication History. Created Date Range is in MM/dd/yyyy format, but Details and Sent are in correct dd/MM/yyyy format.
Recipient Details Note has date in incorrect format.
Communication History filter date picker goes to wrong month based on date...
...and after selecting the right date, displays the date in the field in the wrong format (MM/dd/yyyy).
The filter results include comms based on US date format not en-NZ format.
Also affecting other pages, such as Batch list, date selector in Financial Batch Detail.
This impacts the searching for communications. If the date picker is used, a different result set is selected than if the dates are manually entered.
The dates 2nd June 2024 / 8th June 2024 selected using the date picker gives a result:
The date picker is not correctly applying the date according to the culture.
The dates 2nd June 2024 entered as '02/06/2024' / '08/06/2024' selected returns:
Manually entering the date applies the data according to the culture.
Actual Behavior
Dates displayed are not respecting culture setting.
Expected Behavior
Date picker and date display range should respect culture setting.
Steps to Reproduce
Use a Rock site running 16.5.
View a list of Batches with transactions. Note the date format.
I'm not sure if the global attribute Organization Country Code is relevant.
Change your browsers settings add the language English (New Zealand).
Not sure if you need to change your PC's culture settings.
Review the list of Batches. Date format still in M/dd/yyyy format.
View transactions. Date range will be in US format, dates on individual transactions will be M/dd/yyyy.
Issue Confirmation
- [X] Perform a search on the Github Issues to see if your bug or enhancement is already reported.
- [X] Try to reproduce the problem on a fresh install or on the demo site.
Rock Version
Version 16.5 16.5 (1.16.5.4),
Client Culture Setting
Client Culture Setting: en-NZ, Browser settings Language = English (New Zealand).
We are also experiencing this for Person Attributes. Client Culture: en-AU
If we set an expiry date of 24th February 2025 using the date picker it won't save the date because it is entered as 02/24/2025. All dates entered already prior to updating from v15 are in dd/MM/yyyy format still but dataview criteria doesn't work against them anymore and if we try update the date it goes back to USA formatting not server culture formatting.
@camattard Hi Cameron- I was able to recreate the issue in v16.5 and have added the details to our internal ticket.
@chead4 Thanks! Is there an ETA on when this could be fixed? Or a workaround for us, as this is causing issues for us right across Rock. It is also occurring for us in the schedule builder on all our groups.
@camattard - We changed our browser settings to US, but there are still places this acts inconsistently because the code behaves differently to the date picker.
@ElimAdmin Thank you! This may help us with some critical processes we need to action still until it is fixed.
@ElimAdmin, @camattard all of the above examples should be corrected in v16.7 of Rock. Please let us know if you stumble into any more instances of incorrect date formatting. Thank you!
For future reference, the following commit also addressed this issue: https://github.com/SparkDevNetwork/Rock/commit/822e29469a9c4c7421dc9bd2ba4332ebbb407224