SparkDevNetwork / Rock

An open source CMS, Relationship Management System (RMS) and Church Management System (ChMS) all rolled into one.
http://www.rockrms.com
563 stars 345 forks source link

Some date fields not respecting culture setting (reversion since 16.2) #5898

Open ElimAdmin opened 4 weeks ago

ElimAdmin commented 4 weeks ago

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.

ComHist1

Recipient Details Note has date in incorrect format.

ComHist2

Communication History filter date picker goes to wrong month based on date...

ComHist3

...and after selecting the right date, displays the date in the field in the wrong format (MM/dd/yyyy).

ComHist4

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: Search1

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: Search2

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.

Date6

Date7

Issue Confirmation

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

camattard commented 2 weeks ago

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.

no-date-format-selected rock-server-system-datetime wont-save-date-due-to-format

chead4 commented 2 weeks ago

@camattard Hi Cameron- I was able to recreate the issue in v16.5 and have added the details to our internal ticket.