[SalesForce] Standard DateTime Picker in Visualforce

Does anyone know whether there is a standard Time picker or datetime picker available in Visualforce framework? Visualforce Date picker is a powerful component that can be easily used with . But when we are having DataTime field, there is no way to prompt the user to edit such a field value with a standard component.
Isn't this still available?

Thanks,
Madhura

Best Answer

You can use a new & cool apex:input field that supports many types like time (learn more). Note that the visualforce page need to have a HTML5 doc type for that.

enter image description here

Here is an simple example:

Apex:

public Date myDate { get; set; }

Visualforce:

<apex:page controller="YourController" docType="html-5.0">
    <apex:form>
        Enter Time: 
        <apex:input type="time" value="{!myTime}"/>
    </apex:form>
</apex:page>

The result looks like this in Firefox 25:

enter image description here

Related Topic