Follow this link:
https://engineering.purdue.edu/ECN/Support/KB/Docs/JavascriptCalendar
Above calender format is mm-dd-yyyy. If you want format dd-mm-yyyy then you need to do little bit following changes in javascipt file:
1) In function setDate(year, month, day),
Replace
var dateString = month+"-"+day+"-"+year;
with
var dateString = day+"-"+month+"-"+year;
2) In function show(field)
Replace
selectedMonth = parseInt(dateParts[0],10);
selectedDay = parseInt(dateParts[1],10);
with
selectedDay = parseInt(dateParts[0],10);
selectedMonth = parseInt(dateParts[1],10);
https://engineering.purdue.edu/ECN/Support/KB/Docs/JavascriptCalendar
Above calender format is mm-dd-yyyy. If you want format dd-mm-yyyy then you need to do little bit following changes in javascipt file:
1) In function setDate(year, month, day),
Replace
var dateString = month+"-"+day+"-"+year;
with
var dateString = day+"-"+month+"-"+year;
2) In function show(field)
Replace
selectedMonth = parseInt(dateParts[0],10);
selectedDay = parseInt(dateParts[1],10);
with
selectedDay = parseInt(dateParts[0],10);
selectedMonth = parseInt(dateParts[1],10);
No comments:
Post a Comment