-
Notifications
You must be signed in to change notification settings - Fork 7
/
demo15.html
64 lines (56 loc) · 2.3 KB
/
demo15.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DEMO - zdatepicker - a simple,light-weight datepicker plugin for jquery.</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="./zdatepicker.js"></script>
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" />
<link type="text/css" rel="stylesheet" href="./zdatepicker.css" />
<style type="text/css">
body{ font:12px/120% Helvetica, Geneva, Arial, sans-serif; padding:0px; }
h1{ font-size:25px; color:#333; border-bottom:#CCC dashed 1px; padding:20px 0px; }
h2{ font-size:18px; color:#555; padding:10px 0px; }
h4{ font-size:14px; color:#666; padding:0px; }
h5{ font-size:12px; color:#666; padding:0px; margin:0px; }
.demo{ padding:0px 10px 20px 10px; }
.code{ background:#EEE; border:#CCC dashed 1px; padding:10px; padding-bottom:20px; margin-top:20px; }
.code .syntaxhighlighter{ padding:15px 0px; background:#FFF; margin-bottom:0px!important; }
input{ font:14px/120% Helvetica, Geneva, Arial, sans-serif; border:#999 solid 1px; border-radius:5px; padding:5px 10px; color:#666; }
input:focus{ border:#0080FF solid 1px; box-shadow:inset 0px 0px 5px #999; outline:#0080FF; color:#333; }
dl,dt,dd{ margin:0px; padding:0px; }
</style>
</head>
<body>
<input class="time15" value="" style="width:400px;" />
<script type="text/javascript">
function returnSelect(){
var timeArr = $('.time15').val().split(',');
var sel = {}, i = 0;
for(var x in timeArr){
sel[x+1] = {0:timeArr[x]};
i = x + 1;
}
return i > 1 ? sel : true ;
}
$.fn.zdatepicker.callback = function(type, arg){
if(type == 'next_month'){
alert("goto:"+arg.year+"-"+arg.month);
$(arg.input).focus();
}
}
$(".time15").click(function(){
var sel = returnSelect();
$(this).zdatepicker({
show:true,
viewmonths:1,
selected:sel,
event:false,
onReturn:function(date, dateObj, obj, calendar, a, selected){
if(selected) $(obj).val( selected.join(',') );
}
});
});
</script>
</body>
</html>