No Code Attached Yet
avatar toivo
toivo
12 Feb 2023

Steps to reproduce the issue

Joomla 4.2.8-dev with en-GB language and the language overrides to simulate en-US:

DATE_FORMAT_LC4="m-d-Y"
DATE_FORMAT_FILTER_DATETIME="m-d-Y H:i:s"
DATE_FORMAT_CALENDAR_DATE="%m-%d-%Y"
DATE_FORMAT_FILTER_DATE="m-d-Y"
DATE_FORMAT_CALENDAR_DATETIME="%m-%d-%Y %H:%M:%S"

Enable the option Allow User Registration.
Create a user custom field of type Calendar, 'Date Of Birth'.
Go to the front end and select the option 'Create an account' from the login module.
Fill in the registration form but use an existing username.
Fill in the Date Of Birth from the Calendar button, for example 01-31-2023.
Click the Register button to submit the form.
The form is displayed with the error 'The username you entered is not available. Please pick another username.'

Expected result

The date field is displayed as 01-31-2023

Actual result

The date field is displayed as 31-01-2023

System information (as much as possible)

Joomla 4.2.8-dev of 12 February 2023, en-GB, on Wampserver 3.2.9 using PHP 8.1.10 in Windows 11

Additional comments

Reported first and discussed in the Joomla forum at https://forum.joomla.org/viewtopic.php?f=808&t=999269
When a new user is created at the back end using an existing username and the error message "Save failed with the following error: Username in use" is received, the custom date is displayed correctly.

avatar toivo toivo - open - 12 Feb 2023
avatar toivo toivo - change - 12 Feb 2023
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 12 Feb 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 12 Feb 2023
avatar joomdonation
joomdonation - comment - 15 Feb 2023

Just looked at this and for my test, I even see fatal error. Could anyone else confirms that?

avatar toivo
toivo - comment - 15 Feb 2023

Thank you for looking into this. The forum member who reported the issue reported this error which I was unable to reproduce with my en-GB language with US overrides:

0 DateTime::__construct(): Failed to parse time string (02-24-2023) at position 0
(0): Unexpected character

Ref. https://forum.joomla.org/viewtopic.php?f=808&t=999269#p3684329


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39844.

avatar joomdonation
joomdonation - comment - 15 Feb 2023

I did not make language override but installed US language package to test it, but it should work in the same way. Seems PHP DateTime class could not parse a date in US format for some reasons.

avatar joomdonation
joomdonation - comment - 15 Feb 2023

PR #39863 should address this issue. Please help testing. Thanks !

avatar joomdonation joomdonation - close - 15 Feb 2023
avatar joomdonation joomdonation - change - 15 Feb 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-02-15 11:24:38
Closed_By joomdonation

Add a Comment

Login with GitHub to post a comment