XF 2.0 xf:dateinput options?

Jaxel

Well-known member
The XF dateinput form field is kinda awesome this time around:
Code:
<xf:dateinput name="end[date]" value="{{ date($xf.time, 'Y-m-d') }}" />

What sort of advanced options can I define with this field? Can I define a minimum date?

Can I link two dateinput fields together, so that one can't be before the other?
 
That is not the correct format to use, what you are doing may not work with every language. Please use this code instead:
Code:
<xf:dateinput name="end[date]" value="{{ date($xf.time, 'picker') }}" />
To learn more about what options are available, please inspect public function formDateInput(array $controlOptions) in src/XF/Template/Templater.php.

This is also where you go to learn about virtually every other <xf:XXX> tag as they all get compiled into functions from this file. You can also see all the default filters available (e.g. {$var|filter}, by inspecting the protected $defaultFilters array at the top of this file. Lastly, the protected $defaultFunctions contains all the regular functions you can use inside {{ }} tags.


Fillip
 
Interesting... guess there are bugs in thread_view and member_ban_edit, because they use Y-m-d as well.
 
That's very interesting indeed, I got my information from the user_upgrade_active_edit template in the Admin space. Looks like in the front-end they always use Y-m-d whereas in the admin there's a mix. Maybe I was wrong about the language thing then, as I'm sure they would have tested it, but I'd probably stick with specifying picker as the format juuuuust to be sure.


Fillip
 
Back
Top Bottom