XF 2.0 Exposing of pikaday timepicker

XFA

Well-known member
Hi,

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.

Clément
 
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:
1506864266274.webp

The code to produce that is similar to:
HTML:
<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" />
    </div>
</xf:formrow>
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).
 
Yes indeed that's a good point. I'll most certainly use your suggestion.

Thanks,
Clément
 
Top Bottom