<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js" />
<script type="text/javascript">//<![CDATA[
var title = document.getElementById('title-text').textContent.replace(/^\s+|\s+$/g, ''),
channel = title.replace(/ .*/g, ''),
date = title.replace(/.* /g, ''),
year = date.substr(0,4);
if (date.length = 7) var month=(date.substr(5,2)-1);
else var month="0";
// if you know a better way to do this, it would be much appreciated :)
if (channel == 'openmrs') var startdate = new Date(2008, 0, 25);
else if (channel == 'openmrs-sprint') var startdate = new Date(2011, 3, 06);
else var startdate = newDate(2008, 0, 0);
$(function(){
// Datepicker
$('#calendar').datepicker({
inline: true,
changeMonth: true,
changeYear: true,
dateFormat: 'yy-mm-dd',
minDate: startdate,
maxDate: '-0d',
altField: 'input#date',
defaultDate: new Date(year, month),
onSelect: function goToDate(selected) {
document.location='http://wiki.openmrs.org/display/IRC/' + channel + ' ' + selected;
}
});
//hover states on the static widgets
$('#dialog_link, ul#icons li').hover(
function() { $(this).addClass('ui-state-hover'); },
function() { $(this).removeClass('ui-state-hover'); }
);
});
//]]>