locked
removing past dates in calendar RRS feed

  • Question

  • User1686288870 posted
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery.dynDateTime.min.js" type="text/javascript"></script>
    <script src="Scripts/calendar-en.min.js" type="text/javascript"></script>
    <link href="Styles/calendar-blue.css" rel="stylesheet" type="text/css" />
    
    <script type="text/javascript">
    
    $(document).ready(function () {
    //var dateToday = new Date();
    
    minDate: 0;
    $("#<%=TextBox3.ClientID %>").dynDateTime({
    
    
    
    showsTime: true,
    ifFormat: "%Y/%m/%d %H:%M",
    daFormat: "%l;%M %p, %e %m, %Y",
    align: "BR",
    electric: false,
    singleClick: false,
    minDate: 0,
    displayArea: ".siblings('.dtcDisplayArea')",
    button: ".next()"
    
    });
    

    unable to grade out past dates in dyndatetime jquery

    thanks in advance

    Sunday, April 24, 2016 4:48 PM

Answers

All replies

  • User61956409 posted

    Hi prasannaindia,

    minDate: 0,

    Firstly, please check API documentation of jQuery dynDateTime you are using to make sure if dynDateTime enable us to specify minDate property.

    Secondly, you could use other jQuery datetimepicker plugins, such as bootstrap datetimepicker.

    https://eonasdan.github.io/bootstrap-datetimepicker/Functions/#minmaxdate

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 25, 2016 2:32 AM
  • User-1768369891 posted
    <script src="../js/jquery-1.4.1.min.js" type="text/javascript"></script>
        <script src="../js/jquery.dynDateTime.min.js" type="text/javascript"></script>
        <script src="../js/calendar-en.min.js" type="text/javascript"></script>
        <link href="../css/calendar-blue.css" rel="stylesheet" type="text/css" />
    
        <script type="text/javascript">
    
            $(document).ready(function () {
    
                $("#<%=txtjourneydate.ClientID %>").dynDateTime({
                    showsTime: true,
    
                    ifFormat: "%Y/%m/%d %H:%M",
                    daFormat: "%l;%M %p, %e %m,  %Y",
                    align: "BR",
                    electric: false,
                    singleClick: false,
                    minDate: 0, 
                    displayArea: ".siblings('.dtcDisplayArea')",
                    button: ".next()"
                });
            });
    
        </script>
    
     date: <asp:TextBox ID="txtjourneydate" runat="server" ReadOnly="true" Style="background: #ffffff;
                                                    border: 1px solid #B7B7B7"></asp:TextBox>
                                                <img src="../images/calender.png" alt="" />

    You have to add  minDate: 0,

    minDate: new Date(2010, 0, 1) or can set as today.

    https://davidwalsh.name/jquery-datepicker-disable-days

    Monday, April 25, 2016 3:13 AM