cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

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

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Impactful Individual
Impactful Individual

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

Hi @Ahmad-KAISPE 

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.

 

View solution in original post

6 REPLIES 6
Highlighted
Impactful Individual
Impactful Individual

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

Hi @Ahmad-KAISPE 

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.

 

View solution in original post

Highlighted
Helper IV
Helper IV

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

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.

Highlighted
Impactful Individual
Impactful Individual

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

Hi @Ahmad-KAISPE 

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! 

Highlighted
Helper IV
Helper IV

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

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 

Highlighted
Impactful Individual
Impactful Individual

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

Hi @Ahmad-KAISPE

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? 

Highlighted
Helper IV
Helper IV

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

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. 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (6,449)