Project

General

Profile

Actions

Bug #62660

closed

Copying Date- and Datetime-Fields

Added by Christian Chabek over 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
Start date:
2014-11-03
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Datetime
Complexity:
Is Regression:
No
Sprint Focus:

Description

A Field is defined as datetime in the TCA:

'start' => array(
  // ...
  'config' => array(
    'dbType' => 'datetime',
     // ...
  ),
),

The value gets correctly written to the database.
But when copying an entity in the backend and so copying the field, it shows something strange like "0:33 01-01-1970".

I've tracked this down to here:

// TYPO3\CMS\Core\DataHandling\DataHandler, Line 950
$incomingFieldArray[$column] = $incomingFieldArray[$column] ? gmdate($format, $incomingFieldArray[$column]) : $emptyValue;

Typo3 tries to format the already correctly formatted date-string.
The solution in my case was this check:

if (is_numeric($incomingFieldArray[$column])) {
  $incomingFieldArray[$column] = $incomingFieldArray[$column] ? gmdate($format, $incomingFieldArray[$column]) : $emptyValue;
}
Actions #1

Updated by Mathias Schreiber over 9 years ago

  • Target version set to 7.1 (Cleanup)
Actions #2

Updated by Benni Mack almost 9 years ago

  • Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
Actions #3

Updated by Susanne Moog almost 9 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #4

Updated by Benni Mack over 8 years ago

  • Target version changed from 7.5 to 7 LTS
Actions #5

Updated by Mathias Schreiber over 8 years ago

  • Target version changed from 7 LTS to 8 LTS
  • Tags set to Datetime
Actions #6

Updated by Gerrit Code Review over 8 years ago

  • Status changed from New to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/46426

Actions #7

Updated by Nicole Cordes about 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Gerrit Code Review over 7 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50672

Actions #9

Updated by Gerrit Code Review over 7 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50673

Actions #10

Updated by Gerrit Code Review over 7 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50673

Actions #11

Updated by Gerrit Code Review over 7 years ago

Patch set 3 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50673

Actions #12

Updated by Nicole Cordes over 7 years ago

  • Status changed from Under Review to Resolved
Actions #13

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF