0

I need something like input type='date' when i'm clicking the input on mobile to appear the specific datepicker from phone.. Example for iphone iphone

But I want to display the date how I want.. Exactly what I need is to display the date like this: dd/mm/yy

Apers1952
  • 41
  • 5
  • How about [`datebox`](http://dev.jtsage.com/jQM-DateBox/)? – philantrovert Dec 19 '16 at 11:39
  • 1
    Possible duplicate of [Is there any way to change input type="date" format?](http://stackoverflow.com/questions/7372038/is-there-any-way-to-change-input-type-date-format) – junkfoodjunkie Dec 19 '16 at 11:43
  • Users become familiar with the default UI of their device, it may be confusing or annoying if you mess with that. – RobG Dec 19 '16 at 11:51
  • @RobG yeah but I want just after selecting the date from the default UI of the device, to display selected date ..how I want....that is after the user select what date want – Apers1952 Dec 19 '16 at 12:00
  • The issue with dd/mm/yyyy (and mm/dd/yyyy) is that for many dates it is ambiguous unless you also include a hint of the format. Better to use an unambiguous format like 19 December, 2016. Just a suggestion. ;-) – RobG Dec 19 '16 at 12:05
  • @RobG understand but now after select date on mobile in the input I have for example Dec 19, 2015 instead 19/12/2015. The client want to display the date like this – Apers1952 Dec 19 '16 at 12:09

1 Answers1

0

You can try this HTML5 tag:

<input type="date" value="YYYY-MM-DD"/>

where you can set "value" as the default date.

You can also use min="YYYY-MM-DD" and max="YYYY-MM-DD" for maximum and minimum dates.

and as for the mask "DD/MM/YYYY", I recommend using bootstrap-datepicker, where you can have tons of options to mask as you want.

  • Try looking at this [question] (http://stackoverflow.com/questions/7372038/is-there-any-way-to-change-input-type-date-format?noredirect=1&lq=1) – AndreLuisGO Dec 19 '16 at 11:50
  • Bootstrap-datepicker it's ok for the mask but, not opening the default look on mobile:/ – Apers1952 Dec 19 '16 at 11:58