// Create a new instance of calendar, placing it in
// #mycalendar container, setting its width to 340px,
// the flags for showing previous and next month's
// dates in available empty cells to true, and setting
// the date to today's date.
var calendar = new Y.Calendar({
contentBox: "#mycalendar",
width:'340px',
showPrevMonth: true,
showNextMonth: true,
minimumDate: new Date(2024,4 -1 ,9) ,
maximumDate: new Date(2024,9 -1 ,6) ,
date: new Date(2024, 9 -1 ,6)}).render();
// Get a reference to Y.DataType.Date
var dtdate = Y.DataType.Date;
// Listen to calendar's selectionChange event.
calendar.on("selectionChange", function (ev) {
var newDate = ev.newSelection[0];
var d = newDate.toString().split(" ");
var year = (newDate.getYear() + 1900);
var month = (newDate.getMonth() + 1);
var day = newDate.getDate();
var dstr = year +"年"+ month +"月"+ day +"日";
Y.one("#selecteddate").setHTML(dstr);
for(var i=0;i