cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ahmad-KAISPE
Helper V
Helper V

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
hardikv
Impactful Individual
Impactful Individual

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
hardikv
Impactful Individual
Impactful Individual

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

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.

hardikv
Impactful Individual
Impactful Individual

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! 

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 

hardikv
Impactful Individual
Impactful Individual

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? 

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

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

Users online (69,937)