dates change by itself
var monName = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec");
var d = new Date(id);
var curr_date = d.getDate();
var curr_month = d.getMonth();
var curr_year = d.getFullYear();
return (curr_date + " " + monName[curr_month] + " " + curr_year);
and then this calendar tag:
pattern="d MMM, yyyy"
and for some unknown reason i don't know why the default date format that the textbox accepts is in 'mm/dd/yyyy'
For example if i entered "13-05-2014" then it would return an error stating date is invalid.
If i entered "12-05-2014" then it would return "5 Dec, 2014"
I did not declare any dateformat anywhere except for the datepickers which as shown above, is 'd MMM, yyyy'
Before this happened i trialed and error many different kind of codes to try to validate the date however it all didnt work and so i reverted it all back to the original codes.
Now it still works except that the dateformat changed to 'mm/dd/yyyy'.
I did try to use console.log to find out what's wrong but there were no error messages.
could anyone help me and tell me what is going on here?
Why has the dateformat changed by itself?