Response title
This is preview!
My complete code in jsfiddle: http://jsfiddle.net/kL4ur/
What is wrong?
I am trying to make the datepicker highlight dates fetched from database, and at the same time have the dates as clickable links. I have managed to get the two functions functioning seperately, but it won't work in combination. Possibly becuse the date function is set twice?
Can anybody please tell me what I've done wrong?
The code:
<script>
$(document).ready(function() {
var date1 = new Date;
date1.setHours(0, 0, 0, 0);
date1.setDate(10);
var date2 = new Date;
date2.setHours(0, 0, 0, 0);
date2.setDate(23);
$( "#datepicker" ).datepicker({
dateFormat: 'yy-mm-dd',
showOn: "button",
dayNamesMin: ['Søn', 'Man', 'Tir', 'Ons', 'Tor', 'Fre', 'Lør'],
monthNames: ['Januar', 'Februar', 'Mars', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Desember'],
buttonImage: "images/calendar-blue.png",
buttonImageOnly: true,
onSelect: function(date) {
var links="member.php?date=";
window.location.href = links+date;
}
beforeShowDay: function(date) {
return [date.getDay() < 5, date >= date1 && date <= date2 ? "dp-highlight" : ""];
}
});
});
</script>
© 2013 jQuery Foundation
Sponsored by and others.