Home > other >  How to create input text for date if user input yyyy then append - to the inputbox?
How to create input text for date if user input yyyy then append - to the inputbox?

Time:12-24

I have date format in yyyy-mm-dd, I want to let user to input date if user give 2000 then append - to the date accordingly.

I have datepicker to provide date.

CodePudding user response:

In jQuery use formatDate. docs

$.datepicker.formatDate( "yy-mm-dd", date );

CodePudding user response:

How to get input type date in dd-mm-yyyy format ? body { text-align: center; } h1 { color: green; }

DateInput

Get input date in dd-mm-yyyy format

Enter the Date:
<input type="date" name="begin"
    placeholder="dd-mm-yyyy" value=""
    min="1997-01-01" max="2030-12-31">
  • Related