[TYPO3-mvc] Date examples, can't find any.
Jochen Rau
jochen.rau at typoplanet.de
Tue Jan 19 09:47:31 CET 2010
Hi Nathan.
Back to you initial question ;-)
On 11.01.10 22:10, Nathan Lenz wrote:
> Let's take the date property of Tx_Blogexample_Domain_Model_Post.
>
> What would I add to new.html and edit.html in order to add a simple form
> element for editing the date?
>
> I tried the most obvious but it didn't work. I dug around the form
> viewhelpers and couldn't find anything related to dates.
>
> <label for="date">Date:</label>
> <f:form.textbox property="date" />
>
> Thanks for any pointers,
> --Nathan Lenz
In my edit.html I have:
<f:form method="post" controller="Offer" action="update" name="offer"
object="{offer}">
[...]
<f:form.textbox id="startdate" class="datepicker"
property="dateRange.minimumValue" value="{f:format.date(date:
'{offer.dateRange.minimumValue}', format: 'd.m.Y')}" size="12" />
[...]
</form>
I use jQuery to show the datepicker:
$(function() {
$.datepicker.setDefaults({
regional: 'de',
duration: ''
});
$("#startdate").datepicker({ defaultDate: 'today' });
$("#enddate").datepicker({ defaultDate: '+1m -1d' });
});
I include the JavaScript in my controller. But that’s the rest of the
discussion ...
Regards
Jochen
More information about the TYPO3-project-typo3v4mvc
mailing list