jQuery - datepicker.parseDate on 'mm/y' causing Invalid Date -
i have validate method seems pretty simple because use similar when using format mm/dd/yy
, when use mm/y
...i keep getting invalid date.
here validation:
function validatedate(datefield) { try{ $.datepicker.parsedate('mm/y', datefield, null); } catch(error){ alert(error); } }
if pass in date 05/11
...this logic complains date invalid. if change format mm/dd/yy
, enter 05/11/2011
...then says valid.
am missing when trying validate mm/y
pattern?
unfortunately, need supply @ least month , day datepicker parse date properly. if leave year out, defaults current year, parsing "06/15" "dd/mm" give 2011-06-15. if either month or day omitted, default -1 , produce invalid date.
edit:
if trying confirm user entered valid month , year, this:
$.datepicker.parsedate('dd/mm/y', "01/" + datefield, null);
Comments
Post a Comment