forked from arashm/JCal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
38 lines (32 loc) · 1.18 KB
/
example.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>jCal Test</title>
<meta name="author" content="ArashM">
<link rel="stylesheet" href="build/styles/style.min.css" type="text/css" media="all" />
</head>
<body dir="rtl">
<div class="container"></div>
<script src="build/js/jcal.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
var jcal = require('jcal');
var conf = {
// Bind the calendar to an element. Default is body.
field: document.querySelector('.container'),
// Set the initial date. Set either Date object or an array
// of Jalali date like [1393, 5, 2]. Default is today.
initialDate: [1393, 5, 2],
// The format of calendar date title to show
title_format: 'MMMM YYYY',
// Either show abbreviation of week day names or not. default to true.
showAbbreviated: true
};
var mini_cal = jcal(conf);
mini_cal.on('change', function(date){
console.log(date.format('dddd DD MMMM YYYY'))
});
</script>
</body>
</html>