web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How do I set the calen...
Power Pages
Answered

How do I set the calendar to not allow dates before today's date?

(0) ShareShare
ReportReport
Posted on by

Hi all, 

 

cds_issue9.PNG

 

 

I have a entity form in portal that has a date-picker. I only want to be able to choose only the current or future dates and not the past ones.

 

Is there any possible way to solve this issue?

 

Regards,

Ahmad

Categories:
I have the same question (0)
  • Verified answer
    H V Profile Picture
    1,510 on at

    Hi @Anonymous 

    Please add below code in javascript section in Localized Content of Web Page:

     

    $(document).ready(function() {
     $("#scheduledstart").next().data("DateTimePicker").minDate(moment());
    });

    Then clear the cache and check.

     

  • Community Power Platform Member Profile Picture
    on at

    Thank you hardikv for you response,

     

    This is what i am trying. Portal Management => Entity Forms => additional settings => custom javascript.

     

    cds_issue10.PNG

     

     

     

     

     

     

     

    Is this how should i try to implement? 

    Can you please help me out on this as i am little confused?

     

    Thanks in advance

     

    Regards,

    Ahmad.

  • H V Profile Picture
    1,510 on at

    Hi @Anonymous 

    Go to Portal Management -> Web Page 

    EntityPage.png

    In General Tab, Now you can see "Localized Content" Section. Open that record.

    In content page, Click on "Advanced" tab.

    LocalizedContent.png

     

    There will be "Custom Javascript" field and add code.

     

     

    $(document).ready(function() {
     $("#scheduledstart").next().data("DateTimePicker").minDate(moment());
    });

     

     

    Let me know if you have concern! 

  • Community Power Platform Member Profile Picture
    on at

    Thank you again hardikv,

     

    I followed all steps in a given reply, Unfortunately i don't see any changes in form.

     

    Is there some thing i am missing?

     

    Regards,

    Ahmad 

  • H V Profile Picture
    1,510 on at

    Hi @Anonymous

    Did you change the logical name of the field in given code? 

    What is the logical name of the field? 

    Did you clear the cache? 

  • Community Power Platform Member Profile Picture
    on at

    Hi hardikv

    Sorry for late response, i have tried Web Pages -> Change from Active WebPages to Localize Content -> Book Appointment -> Advance custom javascript. 

     

    Ahmad-KAISPE_0-1594619831390.png

     

     

    This is what I did in localize content and logical name of the field is crf94_datebut one thing about i want to know is whatever I am changing in Portal Management. For example, changing website name from Starter Portal to something else also not working.

     

    What do i have to do after save and close in Portal Management as its not working out.

     

    Please guide me on this as i am confused in the process .

     

    Thanks in advance,

     

    Regards. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 70 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 55

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard