Task #77702

Use moment.js and ISO-8601 dates in the backend

Added by Andreas Wolf almost 3 years ago. Updated 10 months ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Backend User Interface
Target version:
-
Start date:
2016-08-30
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

The backend currently passes around a weird combination of true UTC timestamps and "adjusted UTC" timestamps which are offset by the server timezone offset to UTC. The latter are also stored in the database.

A better solution is to use ISO-8601 dates as widespread as possible and only convert them to/from timestamps at a single location. This way, everything gets more obvious and we can finally tackle using real UTC timestamps in the database.


Related issues

Related to TYPO3 Core - Task #78953: Custom FormDataProvider breaks with date related changes Closed 2016-12-11
Related to TYPO3 Core - Bug #79249: TCA fields with eval types "time" or "timesec" are incorrectly stored in the database Closed 2017-01-10
Related to TYPO3 Core - Bug #83240: TCA field with type=input, eval=date with range is broken, always lower range value is applied because of int cast of incoming value before ISO-8601->unix timestamp conversion. Closed 2017-12-06

Associated revisions

Revision 75beb3fd (diff)
Added by Andreas Wolf over 2 years ago

[TASK] Use ISO-8601 dates for display and processing

This changes the internal date processing for FormEngine and DataHandler
to use ISO-8601 dates including a proper timezone. Dates are converted
to ISO-8601 as early as possible and converted back to UNIX timestamps
as late as possible.

As before, the database values are always values in the server’s
timezone, interpreted as UTC. Also, the client side inputs are
interpreted as UTC.

The main advantage is that once and for all we get rid of the timezone
issues that may potentially arise if the server and client use different
timezones. Additionally, the values are human readable (which is of
course not so much of an issue for hidden fields) and we can directly
use Moment.js for all heavy lifting.

Another big advantage is that we can make the date formats configurable
and decouple displayed dates and internally stored dates (by putting the
Moment objects to the input fields).

Change-Id: I3461915c2beaa96cd29c52c60e65a2e5005065b7
Resolves: #77702
Releases: master
Reviewed-on: https://review.typo3.org/47124
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Tested-by: TYPO3com <>
Reviewed-by: Oliver Hader <>
Tested-by: Oliver Hader <>

Revision e50f9966 (diff)
Added by Oliver Hader over 2 years ago

[FOLLOWUP][TASK] Use ISO-8601 dates for display and processing

Adjust acceptance tests for ISO-8601 date/-time values.

Change-Id: Ib35af231f8f8b8150eb0e132543be060eeff67da
Resolves: #77702
Releases: master
Reviewed-on: https://review.typo3.org/50880
Tested-by: TYPO3com <>
Tested-by: Susanne Moog <>
Reviewed-by: Oliver Hader <>
Tested-by: Oliver Hader <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>

Revision 7c0ddc7a (diff)
Added by Thomas Hohn over 2 years ago

[BUGFIX] Editing start-/end time of scheduled task not working correctly

The start/end value can now contain either the start-/end time as
unix timestamp or as formatted date when using the datepicker.
In the later case the value must be converted to an unix timestamp
before storing it in the DB.

Resolves: #79814
Related: #77702
Releases: master
Change-Id: I750c1bc6d4634b89423e26a0dea48d2001115f18
Reviewed-on: https://review.typo3.org/51960
Tested-by: TYPO3com <>
Reviewed-by: Christer V <>
Reviewed-by: Joerg Boesche <>
Tested-by: Joerg Boesche <>
Reviewed-by: Josef Glatz <>
Tested-by: Josef Glatz <>
Reviewed-by: Thomas Maroschik <>
Tested-by: Thomas Maroschik <>
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>
Reviewed-by: Frank Nägler <>
Tested-by: Frank Nägler <>

History

#1 Updated by Gerrit Code Review almost 3 years ago

  • Status changed from In Progress to Under Review

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

#2 Updated by Gerrit Code Review almost 3 years ago

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

#3 Updated by Gerrit Code Review almost 3 years ago

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

#4 Updated by Gerrit Code Review almost 3 years ago

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

#5 Updated by Gerrit Code Review almost 3 years ago

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

#6 Updated by Gerrit Code Review almost 3 years ago

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

#7 Updated by Gerrit Code Review almost 3 years ago

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

#8 Updated by Gerrit Code Review over 2 years ago

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

#9 Updated by Gerrit Code Review over 2 years ago

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

#10 Updated by Gerrit Code Review over 2 years ago

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

#11 Updated by Gerrit Code Review over 2 years ago

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

#12 Updated by Andreas Wolf over 2 years ago

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

#13 Updated by Gerrit Code Review over 2 years ago

  • Status changed from Resolved to Under Review

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

#14 Updated by Gerrit Code Review over 2 years ago

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/50880

#15 Updated by Gerrit Code Review over 2 years ago

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

#16 Updated by Gerrit Code Review over 2 years ago

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

#17 Updated by Gerrit Code Review over 2 years ago

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

#18 Updated by Gerrit Code Review over 2 years ago

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

#19 Updated by Gerrit Code Review over 2 years ago

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

#20 Updated by Oliver Hader over 2 years ago

  • Status changed from Under Review to Resolved

#21 Updated by Oliver Hader over 1 year ago

  • Related to Bug #83240: TCA field with type=input, eval=date with range is broken, always lower range value is applied because of int cast of incoming value before ISO-8601->unix timestamp conversion. added

#22 Updated by Benni Mack 10 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF