joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.76k stars 3.65k forks source link

Calendar field is not working when format="%a %e %b %Y" is used #41194

Closed madanedeepali closed 1 year ago

madanedeepali commented 1 year ago

Steps to reproduce the issue

Create a calendar field in any component's XML file with the following details <field name="nextdate" class="inputbox" format="%a %e %b %Y" timeformat="24" filter="server_utc" translateformat="false" showtime="false" singleheader="false" todaybutton="false" weeknumbers="false" filltable="false" type="calendar" label="Next Date" description=" Enter the next date" hint=" you can select the next date in the format "/>

Expected result

The selected date should get saved in the database in the respected table.

Actual result

Saved Successfully message gets displayed not an error but the date is not getting saved in the database.

System information (as much as possible)

The issue is present in both Joomla3 and Joomla4

Additional comments

You can also try adding this field in the core Joomla contact component for cross-checking it does not work there also

madanedeepali commented 1 year ago

@dziudek @pollen8 @elkuku can you check ASAP

chmst commented 1 year ago

What do? you mean with %e? I cannot find this in the date https://www.php.net/manual/de/datetime.format.phptime format

madanedeepali commented 1 year ago

The link you provided not working for me. %e means Day of the month without leading zeros (1 to 31) You can refer to the document here https://docs.joomla.org/Calendar_form_field_type

madanedeepali commented 1 year ago

@chmst any update on the above issue

brianteeman commented 1 year ago

please do not tag people. especially repeatedly. No idea why you chose those people but one is a bot and another is not active

chmst commented 1 year ago

Sorry, the link is: https://www.php.net/manual/en/datetime.format.php and I did not read correctly my apologies.

I tested your field with J4.3.3, php 8.2 and got a deprecated message, but the input is saved correctly in the database.

grafik

EDIT: second test with a date with only 1 digit in day and confirm your issue.

Fedik commented 1 year ago

@madanedeepali you missing filterformat="D j M Y" in your XML. Hovewer there also another bug.

Please test #41224

madanedeepali commented 1 year ago

@Fedik Added filterformat="D j M Y" in the XML file still facing the same issue

Fedik commented 1 year ago

@madanedeepali please test the fix #41224, then it will work