-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
75 lines (67 loc) · 3.87 KB
/
demo.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Cari Agency Period Picker</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="dist/period-picker.css" rel="stylesheet" type="text/css"/>
<style>
.container{
margin-top: 50px;
}
h1, .card-body{
margin-bottom: 30px;
}
#output{
min-height: 170px;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col">
<h1>Cari periodPicker demo</h1>
<div class="card card-body">
<pre id="output">Select a period in following picker to see default output.</pre>
</div>
<p>
<button type="button" class="btn btn-primary" data-toggle="period-picker">Default</button>
<button type="button" class="btn btn-primary" data-toggle="period-picker" data-year="2016" data-min="2015/05" data-max="2017/08" data-active="2016/Q3">Markup options</button>
<button type="button" class="btn btn-primary" id="period-picker-custom">Custom</button>
</p>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/locale/fr.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="dist/period-picker.js" type="text/javascript"></script>
<script type="text/javascript">
(function ($) {
$.fn.periodPickerDefaults.pick = function (value) {
$('#output').text('// start and end keys contain a moment.js object\n' + JSON.stringify(value, null, 4));
};
$('document').ready(function () {
$('[data-toggle="period-picker"]').periodPicker();
$('#period-picker-custom').periodPicker({
btnClass: 'btn btn-success',
yearName: 'Année complète',
quarterName: 'T',
prevTemplate: '<i class="fa fa-arrow-left"></i>',
nextTemplate: '<i class="fa fa-arrow-right"></i>',
pick: function (value) {
$('#output').text('// start and end keys contain a moment.js object\n' + JSON.stringify(value, null, 4));
return true;
}
});
});
}(jQuery));
</script>
</body>
</html>