forked from Twipped/Kalendae
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
83 lines (75 loc) · 1.84 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!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',
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',
blackout: function (date) {
return [1,0,0,0,0,0,1][Kalendae.moment(date).day()]; //blackout weekends
},
/*
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);
}
}
*/
});
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>