0

I am using custom datepicker. In that, i am following standard date format structures. in this user can provide the last two digit of the year else 4 digits. So, I need to validate this two different formats and then process. How to proceed this? Is there any other format available which accept the year as both 2 digits or 4 digits format. For example if i am giving date to "11/09/1999" its should convert to 11/09/99 properly on focus out

Sasi Dhivya
  • 501
  • 2
  • 7
  • 25
  • Possible duplicate of [Javascript - Regex to validate date format](http://stackoverflow.com/questions/7388001/javascript-regex-to-validate-date-format) – Vasilij Altunin Mar 08 '17 at 06:08

1 Answers1

0

Why dont you try the input type 'Date' instead of using a custom datepicker. The input date tags will be helpful to handle data easily.

<input type="date" id="myDate" value="2014-02-09"> 
Gowtham Shiva
  • 3,802
  • 2
  • 11
  • 27
  • No i am in situation to use custom datepicker. Also in that if i give 09/19/1999 its should convert to 09/19/99 – Sasi Dhivya Mar 08 '17 at 06:39
  • Share the code that you use to get date with the custom date picker. Just wanted to know how the custom datepicker is used. – Gowtham Shiva Mar 08 '17 at 06:46