-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestDateTime.html
More file actions
61 lines (58 loc) · 2.06 KB
/
Copy pathtestDateTime.html
File metadata and controls
61 lines (58 loc) · 2.06 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="jquery-3.1.1.min.js"></script>
<script src="semantic.min.js"></script>
<script src="js/calendar-edit.js"></script>
<link rel="stylesheet" href="css/calendar.css">
<link rel="stylesheet" href="semantic.min.css">
</head>
<body>
<h3>Input</h3>
<div class="ui calendar" id="example1">
<div class="ui input left icon">
<i class="calendar icon"></i>
<input type="text" placeholder="Date/Time">
</div>
</div>
</body>
<script>
var calendarText = {
days: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'],
months: ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'],
monthsShort: ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'],
today: 'Today',
now: 'Now',
am: 'AM',
pm: 'PM'
}
$('#example1').calendar({
type : 'date',
ampm: false,
text :calendarText,
formatter: {
// dayHeader: function (date, settings) {
// var month = settings.text.months[date.getMonth()];
// var year = date.getFullYear()+543;
// return month + ' ' + year;
// },
// monthHeader: function (date, settings) {
// return date.getFullYear()+543;
// },
// yearHeader : function(date, settings) {
// var decadeYear = Math.ceil((date.getFullYear()+543) / 10) * 10;
// return (decadeYear - 9) + ' - ' + (decadeYear + 2);
// },
date: function (date, settings) {
if (!date) return '';
var day = date.getDate();
var month = settings.text.monthsShort[date.getMonth()];
var year = date.getFullYear();
return day + '/' + month + '/' + year;
}
}
});
</script>
</html>