XF 2.0 Exposing of pikaday timepicker


Formerly MtoR

Well this ain't really a discussion but more a question to the developers.

Is there any particular reason why you didn't expose the showTime option of your pikaday version ?
This may not be useful for xF different uses of the tag but it may be for add-on developers.

I could of course make a new handler to override that but I feel this is something that could be coming in the core.


Chris D

XenForo developer
Staff member
We just wanted to make the underlying library code available for it. The changes for it might be larger than you'd be expecting, so might not be appropriate as a simple handler extension, it would likely need its own handler.

As well as getting it to parse the selected time into a reasonable string, the input filterer itself doesn't support filtering a date string to a specific time so you would need your own code to create a DateTime object set at a specific time.

If you're going to have to do all of that anyway, then you'd might as well just use an input group and have two fields:

The code to produce that is similar to:
<xf:formrow label="Label" rowtype="input">
    <div class="inputGroup">
        <xf:dateinput name="start_date" value="{{ date($xf.time, 'Y-m-d') }}"    />
        <span class="inputGroup-splitter"></span>
        <xf:textbox type="time" name="start_time" value="08:30" />
That uses Pikaday with a standard HTML5 time input.

Any request for change in the core would be best posted as a Suggestion (though check if one exists, already).