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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Pages
Answered

Disable field date

(0) ShareShare
ReportReport
Posted on by 312

Hello community, I am working with a portal in power apps. 

Using the following script I am trying to disable the dates. Only I'm looking to disable two days after the current date.

MartinVargas_0-1647383031007.png

 

 

The output of this script is as follows:

MartinVargas_1-1647383031010.png

 

 

What is in yellow is disabled and that's fine. And what's green, I'm trying to disable 15,16,17 by taking today's date (15).


Can someone help me here? 

I would appreciate it guys

 

Categories:
  • Verified answer
    ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @MartinVargas 

     

    Please try the following 

     

     

    // disable dates in the future (3 days in this example)
    $("#your_fieldname").next().data("DateTimePicker").maxDate(moment().add(3,'days')) 

     

    Thanks and kudos to @Fubar for this. 

     

    Hope it helps. 
    ------------

    If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

     

     

     

     

     

  • MartinVargas Profile Picture
    312 on at

    Hi @ragavanrajan Thank you very much. I actually make use of "minDate"

     

    Also I found this way:

     

     

     

    $(document).ready(function(){
     
     var fecha = new Date();
     var fechaMes = fecha.getMonth()+1;
     var fechaDia = fecha.getDate()+3;
     var fechaAño = fecha.getFullYear(); 
     var appFecha = "'" + fechaAño + "-" + fechaMes + "-" + fechaDia + "'";
     console.log(appFecha);
    
     // disable dates in the future (3 days in this example)
     $('#crb57_fechadeentrega').next().data("DateTimePicker").minDate(moment(appFecha));
     
    });

     

     

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 35

#2
M Bilal Khan Profile Picture

M Bilal Khan 33

#3
11manish Profile Picture

11manish 21 Super User 2026 Season 2

Last 30 days Overall leaderboard