Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
84 lines (76 sloc) 1.86 KB
<!DOCTYPE HTML>
<html lang="ru-RU">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="build/kalendae.css" type="text/css" charset="utf-8">
<script src="build/kalendae.js" type="text/javascript" charset="utf-8"></script>
<style type="text/css" media="screen">
.kalendae span.closed {
background:red;
}
</style>
</head>
<body>
<h1>Kalendae</h1>
<script type="text/javascript" charset="utf-8">
var k1 = new Kalendae(document.body, {
months:1,
selected:'2-2-2012',
format:'DD-MM-YYYY',
mode:'single',
blackout: function (date) {
return Kalendae.moment(date).date() % 2; //blackout every other day
},
dateClassMap: {
'2012-02-22':'closed'
}
});
var k2 = new Kalendae({
attachTo:document.body,
months:2,
selected:'2/3/2012 - 3/15/2012',
mode:'range',
/*
subscribe: {
'change':function () {
console.log('change', this.getSelected());
},
'date-clicked':function (date) {
console.log('date-clicked', date);
},
'view-changed':function (direction) {
console.log('view-changed', direction);
}
}
*/
blackout: function (date) {
return [1,0,0,0,0,0,1][Kalendae.moment(date).day()]; //blackout weekends
}
});
var k3 = new Kalendae({
attachTo:document.body,
months:3,
selected:'2/3/2012, 3/15/2012, 4/2/2012',
mode:'multiple',
blackout: function (date) {
return Kalendae.moment(date).format('w') % 2; //blackout every other week
},
direction: 'past'
});
</script>
<hr>
Click this input element: <input type="text" value="2/16/2012" id="input1">
<script type="text/javascript" charset="utf-8">
var k4 = new Kalendae.Input('input1', {
months:2
});
</script>
<hr>
This calendar is auto-created.
<div class="auto-kal"></div>
<hr>
So is the one on this input.
<input type="text" class="auto-kal">
</body>
</html>