aboutsummaryrefslogtreecommitdiffstats
path: root/demos/functional/templates/ui.datepicker.dbd.html
blob: e686b3d252d0bb530d3a9988a75be36699a85d9a (plain)
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
<input type="text" size="10" value="" id="dayByDay"/>
<style type="text/css">
.ar_day { color: white !important; background: #eee url(templates/images/ar.gif) no-repeat center !important; }
.au_day { color: blue !important; background: #eee url(templates/images/au.gif) no-repeat center !important; }
.br_day { color: green !important; background: #eee url(templates/images/br.gif) no-repeat center !important; }
.cn_day { color: red !important; background: #eee url(templates/images/cn.gif) no-repeat center !important; }
.id_day { color: white !important; background: #eee url(templates/images/id.gif) no-repeat center !important; }
.ie_day { color: white !important; background: #eee url(templates/images/ie.gif) no-repeat center !important; }
.ke_day { color: red !important; background: #eee url(templates/images/ke.gif) no-repeat center !important; }
.lb_day { color: white !important; background: #eee url(templates/images/lb.gif) no-repeat center !important; }
.nz_day { color: blue !important; background: #eee url(templates/images/nz.gif) no-repeat center !important; }
.se_day { color: blue !important; background: #eee url(templates/images/se.gif) no-repeat center !important; }
.us_day { color: white !important; background: #eee url(templates/images/us.gif) no-repeat center !important; }
.za_day { color: green !important; background: #eee url(templates/images/za.gif) no-repeat center !important; }
</style>
<script type="text/javascript">
var natDays = [[1, 26, "au"], [2, 6, "nz"], [3, 17, "ie"], [4, 27, "za"], [5, 25, "ar"], [6, 6, "se"], 
    [7, 4, "us"], [8, 17, "id"], [9, 7, "br"], [10, 1, "cn"], [11, 22, "lb"], [12, 12, "ke"]]; 
 
function nationalDays(date) { 
    for (i = 0; i < natDays.length; i++) { 
        if (date.getMonth() == natDays[i][0] - 1 && date.getDate() == natDays[i][1]) { 
            return [false, natDays[i][2] + "_day"]; 
        } 
    } 
    return [true, ""]; 
}

function highlightToday(date, inst) { 
    var today = new Date(); 
    today = new Date(today.getFullYear(), today.getMonth(), today.getDate()); 
    return $.datepicker.dateStatus(date, inst) + 
        (today.getTime() == date.getTime() ? " (today)" : ""); 
} 

function showDayOfYear(date) {
	var lastYearEnd = new Date(date.getFullYear() - 1, 12 - 1, 31, 0, 0, 0, 0);
	return [true, "", "Day " + ((date.getTime() - lastYearEnd.getTime()) / 86400000) + " of  the year"];
}
</script>