[Neos] Neos DateTime handling

Rens Admiraal rens.admiraal at typo3.org
Tue Mar 18 21:29:00 CET 2014


Hi all,

Today I played around with the datepicker so see how the time / datetime 
capabilities work. It seems to work pretty awesome, you can for example 
create a timepicker by using the following config:

     time:
       type: date
       ui:
         label: 'Some Time'
         inspector:
          editorOptions:
            format: 'h:ii'
          group: 'someGroup'

Or date + time picker by using:

     dateAndTime:
       type: date
       ui:
         label: 'Some Date with Time'
         inspector:
          editorOptions:
            format: 'dd-mm-yyyy h:ii'
          group: 'someGroup'


As you can see, just setting the format is enough. *BUT* we do have an 
issue here. As the original datepicker did only support dates we 
hardcoded the transfer format between the client and server in: 
'yyyy-mm-dd'. This is done in the DateTimeEditor (js), 
ContentElementWrappingService (Neos) and NodeConverter (CR). This causes 
the time information to get lost on storage, so we need to fix that in 
some way.

I played around with the code and come up with: 
https://review.typo3.org/#/q/status:open+branch:master+topic:datetime,n,z

I tried to use the \DateTime::ISO8601 constant, but that one adds an 
offset which causes troubles on the client side at the moment. So I used 
the ISO8601 format without offset.

But before digging too deep it might make sense to step back a little 
and decide how we want to handle timezone differences between server and 
client and so on.

Do you have any thoughts on that?

Greetz,
Rens


More information about the Neos mailing list