diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js index 999cee0a9515113e434bfb637cf10331e3b6a95e..da7b1ca3e9d726390bec93f5d0d059012698e2f6 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js @@ -716,13 +716,6 @@ define(['jquery', 'moment'], function ($, moment) { } var year = (values.values[3]) ? FormEngineValidation.parseInt(values.values[3]) : FormEngineValidation.getYear(today); - if ((year >= 0 && year < 38) || (year >= 70 && year < 100) || (year >= 1902 && year < 2038)) { - if (year < 100) { - year = (year < 38) ? year += 2000 : year += 1900; - } - } else { - year = FormEngineValidation.getYear(today); - } var usMode = FormEngineValidation.USmode ? 1 : 2; var month = (values.values[usMode]) ? FormEngineValidation.parseInt(values.values[usMode]) : today.getUTCMonth() + 1; usMode = FormEngineValidation.USmode ? 2 : 1; @@ -731,7 +724,6 @@ define(['jquery', 'moment'], function ($, moment) { var theTime = moment.utc(); theTime.year(parseInt(year)).month(parseInt(month)-1).date(parseInt(day)).hour(0).minute(0).second(0); - FormEngineValidation.lastDate = theTime.unix(); } FormEngineValidation.lastDate += add * 24 * 60 * 60; @@ -836,13 +828,6 @@ define(['jquery', 'moment'], function ($, moment) { add = FormEngineValidation.pol(values.valPol[2], FormEngineValidation.parseInt(values.values[2])); } var year = (values.values[1]) ? FormEngineValidation.parseInt(values.values[1]) : FormEngineValidation.getYear(today); - if ((year >= 0 && year < 38) || (year >= 70 && year<100) || (year >= 1902 && year < 2038)) { - if (year < 100) { - year = (year < 38) ? year += 2000 : year += 1900; - } - } else { - year = FormEngineValidation.getYear(today); - } FormEngineValidation.lastYear = year; } FormEngineValidation.lastYear += add; diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-81973-FormEngineValidationparseDateRemoveFixYear2038.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-81973-FormEngineValidationparseDateRemoveFixYear2038.rst new file mode 100644 index 0000000000000000000000000000000000000000..b0741d91f61fe37095a81cf3e45f053d150af9d1 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-81973-FormEngineValidationparseDateRemoveFixYear2038.rst @@ -0,0 +1,40 @@ +.. include:: ../../Includes.txt + +======================================================================== +Breaking: #81973 - FormEngineValidation.parseDate remove fixed year 2038 +======================================================================== + +See :issue:`81973` + +Description +=========== + +In issue :issue:`81940` the TCA range upper bound was removed. +But in the file ``typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js`` in method +:js:`FormEngineValidation.parseDate` a fixed year 2038 was included. + +The result: it was impossible to set a date after year 2038 in datetime fields. +This limitation is now removed. The date is always set to the current date. + +A second problem: It was impossible to enter a date < 100 because there were magically added numbers: 2000 for values +between 0 and 38 and 1900 for values between 39 and 100. + + +Impact +====== + +The magic in calculating date values, e.g. entering 12 will result in 2012, is now removed. + + +Affected Installations +====================== + +This affects only the behavior in backend record editing forms. Values of 0 to 100 will not be changed anymore. + + +Migration +========= + +No migration, this behavior was wrong and there is no migration possible. + +.. index:: Backend, FlexForm, JavaScript, NotScanned diff --git a/typo3/sysext/core/Tests/Acceptance/Backend/Formhandler/ElementsBasicInputCest.php b/typo3/sysext/core/Tests/Acceptance/Backend/Formhandler/ElementsBasicInputCest.php index 12a592a95812f4dc1dd73dfdf2c54d067ac9fa7d..95fdbc4fca7f8d585402dce4f2f200a1fba1cb97 100644 --- a/typo3/sysext/core/Tests/Acceptance/Backend/Formhandler/ElementsBasicInputCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Backend/Formhandler/ElementsBasicInputCest.php @@ -183,9 +183,9 @@ class ElementsBasicInputCest extends AbstractElementsBasicCest ], [ 'inputValue' => '12', - 'expectedValue' => '2012', - 'expectedInternalValue' => '2012', - 'expectedValueAfterSave' => '2012', + 'expectedValue' => '12', + 'expectedInternalValue' => '12', + 'expectedValueAfterSave' => '12', 'comment' => '', ], [