function dateChanged(calendar) { // Beware that this function is called even if the end-user only // changed the month/year. In order to determine if a date was // clicked you can use the dateClicked property of the calendar: if (calendar.dateClicked) { // OK, a date was clicked, redirect to /yyyy/mm/dd/index.php var y = calendar.date.getFullYear(); var m = calendar.date.getMonth() + 1; // integer, 0..11 var d = calendar.date.getDate(); // integer, 1..31 // redirect... window.location = "" + "archive.php?isuuedate=" + y + "-" + m + "-" + d; } }; Calendar.setup( { inputField : "data", // ID of the input field ifFormat : "%Y-%m-%d", // the date format onSelect : dateChanged, // our callback function firstDay : 0, weekNumbers : false, range : [2006, 2009] } );