Feature #27417

DateTime conversion support

Added by Robert Lemke almost 10 years ago. Updated almost 10 years ago.

Status:
Resolved
Priority:
Should have
Category:
Property
Start date:
2011-06-14
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

It should be possible to submit a date through a form via POST and receive a date time object as an argument in a controller. Hence we need a Type Converter supporting array to DateTime conversion. The input format should be configurable, unix timestamp would be a good default.


Files

StringToDateTimeConverter.php (4.32 KB) StringToDateTimeConverter.php Bastian Waidelich, 2011-06-14 01:13
ArrayToDateTimeConverter.php (3.77 KB) ArrayToDateTimeConverter.php Robert Lemke, 2011-06-16 16:32
ArrayToDateTimeConverterTest.php (4.32 KB) ArrayToDateTimeConverterTest.php Robert Lemke, 2011-06-16 16:32

Related issues

Related to TYPO3.Flow - Feature #5660: Implement support for Object ConvertersResolvedRobert Lemke2009-12-07

Actions
Related to TYPO3.Flow - Bug #35369: DateTimeConverter's timezone key leads to unexpected behaviorResolvedKarsten Dambekalns2012-12-25

Actions
Has duplicate TYPO3.Flow - Feature #29564: Change \TYPO3\FLOW3\Property\TypeConverter\DateTimeConverter in order to compose a DateTime property from two input fieldsClosedBastian Waidelich2011-09-08

Actions
#1

Updated by Bastian Waidelich almost 10 years ago

Hi Robert,

we need this for the next sprint release for the T3CON11 site, so I started working on this before the weekend.
Attached my first version, hope that helps.

#2

Updated by Bastian Waidelich almost 10 years ago

A few more notes after quickly discussing this with Sebastian:
- We probably shouldn't use Timestamp as default date format as its timezone dependent
- The default date should be an ISO date format that also contains the time
- The DateTimeConverter might also support an array that contains the format string

I'll take care of the above changes and push a version to gerrit (to the FLOW3 package) if no-one objects. Robert Lemke if you already started working on this, let me know.

#3

Updated by Bastian Waidelich almost 10 years ago

  • Assignee changed from Robert Lemke to Bastian Waidelich

I am so bold as to overtake this issue because I'm currently working on this (see above).

#4

Updated by Mr. Hudson almost 10 years ago

Patch set 1 of change I61e7038d89fe0a3a79ee85b3f81250244c1d12df has been pushed to the review server.
It is available at http://review.typo3.org/2762

#5

Updated by Robert Lemke almost 10 years ago

For the record I attached the DateTimeConverter I've been coding in San Francisco.

#6

Updated by Mr. Hudson almost 10 years ago

Patch set 2 of change I61e7038d89fe0a3a79ee85b3f81250244c1d12df has been pushed to the review server.
It is available at http://review.typo3.org/2762

#7

Updated by Bastian Waidelich almost 10 years ago

  • Subject changed from Basic DateTime conversion support to DateTime conversion support

With the new changeset I have just pushed, it is possible to override dateFormat, time and timezone on the client side:

<input type="hidden" name="newPost[date][dateFormat]" value="d.m.Y" />
<label for="date">Date (d.m.Y)</label>
<input type="text" name="newPost[date][date]" id="date" />
<label for="hour">Time</label>
<select name="newPost[date][hour]" id="hour">
    <option value="1">01</option>
    [...]
</select>:
<select name="newPost[date][minute]" id="minute">
    <option value="1">01</option>
    [...]
</select>
<label for="timezone">Timezone</label>
<select name="newPost[date][timezone]" id="timezone">
    <option value="Africa/Abidjan">Africa/Abidjan</option>
    [...]
</select>

#8

Updated by Mr. Hudson almost 10 years ago

Patch set 3 of change I61e7038d89fe0a3a79ee85b3f81250244c1d12df has been pushed to the review server.
It is available at http://review.typo3.org/2762

#9

Updated by Mr. Hudson almost 10 years ago

Patch set 4 of change I61e7038d89fe0a3a79ee85b3f81250244c1d12df has been pushed to the review server.
It is available at http://review.typo3.org/2762

#10

Updated by Bastian Waidelich almost 10 years ago

  • Status changed from Accepted to Under Review
#11

Updated by Bastian Waidelich almost 10 years ago

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

Also available in: Atom PDF