The created date does not match the input value

Created on 7 October 2021, over 3 years ago
Updated 16 November 2023, over 1 year ago

Problem/Motivation

For the date 29/02/1443 the following error will appears "The created date does not match the input value. in Drupal\Component\Datetime\DateTimePlus::createFromFormat()"
This happened because of this function convertToDrupalDateTime, as 29/02/1443 is wrong date in the gregorian date

Steps to reproduce

$taarikh = \Drupal::service('plugin.manager.taarikh_algorithm');
 $algorithm = $taarikh->createInstance('fatimid_astronomical');
 $hijri_date = $algorithm->constructDateFromFormat('29/02/1443', "d-m-Y");
🐛 Bug report
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

🇯🇴Jordan Anas_maw

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇨🇦Canada hussainweb

    I just committed a few changes related to timezones in 📌 Handle timezones Fixed and that might be tangentially related. Can you try this again?

  • 🇧🇷Brazil mabho Rio de Janeiro, RJ

    This error is showing up to me when I set something that Drupal probably sees as an invalid value.

    In order to reproduce it, please try this:

    • Navigate to /admin/structure/events/series/settings
    • Update the value of Event Series Minimum Time to something in the 0 hour range (e.g.: 00:00am or 00:30am).
    • Save the settings form.
    • Navigate to /events/add/default.
    • Check the WSOD being displayed with the exact message on this thread.

    It appears 0:00am is not a valid format; apparently I should use 12:00am instead. I changed the configuration on /admin/structure/events/series/settings to 12:00am and it resumed working, now the starting time on the range is midnight (0 hour). Ok, I wonder if there should be a form validation to confirm the date entered by the user in Event Series Minimum Time is a valid format to be processed by Drupal\Component\Datetime\DateTimePlus::createFromFormat() or not.

Production build 0.71.5 2024