I have a classic HTML date input: <input type="date" name="dto" id="date_timepicker_end">
Now I need to change this format to be dd/mm/yyyy, and I know I can't change that in html.
When I add the jQuery datepicker I just get a blank input form where you can type any number you want:
I need the input to be just like the HTML input, where the user clicks on the input and can just change the value according to what he clicked. I don't want him to be able to write any random number.
Also note, this is all custom code in a wordpress theme, so I have jquery and my custom javascript and css. I can't add libraries like moment.js and so on...
What is the best solution for this problem ? I know it has been asked a lot of times, but none of those methods work me for because I need the input field to be like a normal HTML input date field, not an empty input, dd/mm/yyyy instead if mm/dd/yyyy.
jsfiddle: https://jsfiddle.net/t4zrrvgL/