Activity Forums Salesforce® Discussions How to get standard date picker custom Visualforce in Salesforce?

  • Deepak

    Member
    December 10, 2019 at 2:40 PM

    Please find the below examples to display the date field with date pickers.

    Ex 1 :
    Visual Force Page :
    <apex:page docType="html-5.0" controller="Sample">
    <apex:form >
    <apex:pageBlock >
    <apex:pageBlockSection>
    <apex:pageBlockSectionItem>
    Date: <apex:input type="date" value="{!dat}"/>
    </apex:pageBlockSectionItem>
    </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
    </apex:page>

    Apex Controller :
    public class Sample {
    public Date dat {get;set;}
    public Sample() {

    }
    }

    Ex 2 :
    Visual Force Page :
    <apex:page controller="datePicker" id="mypage">
    <apex:form>
    Date: <apex:inputText value="{!datename}" size="10" id="demo" onfocus="DatePicker.pickDate(false, this , false);" />
    </apex:form>
    </apex:page>

    Apex Controller :
    public class DatePicker
    {
    public String datename {get; set;}
    }

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Pros & Cons of Lightning Component vs. 3rd party frameworks in Salesforce UI development

Video in

Nikita drops by to share his invaluable experience of using popular 3rd party frameworks in Salesforce. http://media.blubrry.com/salesforceway/audio.xmcdn.com/group42/M05/25/57/wKgJ81rXk6XjaZIAAU_I_KtprFM998.m4a