Home > Software design >  How to remove default selected date in Calendar @material-ui/pickers?
How to remove default selected date in Calendar @material-ui/pickers?

Time:07-19

I am using the calendar in my project https://material-ui-pickers.dev/demo/datepicker. When I open the calendar by clicking a textbox for the very first time, I don't want today's date to be selected and want it to be empty. Can anyone help me with how do I achieve this??

CodePudding user response:

I am not using a standard Power Apps form so I am not able to use the Parent values. I added an X icon with the following OnSelect UpdateContext({locResetDate: true}); Reset(DatePickerControl)

and changed the DefaultDate in the date picker to If(!locResetDate, [original date])

CodePudding user response:

*** Why cant't you try using jQuery***

<html>
    <head>
        <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
        <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
        <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
        <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
        <link rel="stylesheet" href="/resources/demos/style.css">
        <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
        <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    </head>
    <script>
         $(function ()
              {
                var single = $("#single_date").datepicker({ })
              });
    </script>
    <body>
            <label> Date :</label>
            <input type="text" name="single_date" id="single_date" >
    </body>
</html>
  • Related