<zk >
<datebox></datebox>
<script type="text/javascript"><![CDATA[
//var letturaDates = '${dates}'
var letturaDates= ['09/03/2011', '10/03/2011'];
//alert(letturaDates);
//var letturaErrorDates = '${errorDates}'
//alert(letturaErrorDates);
var letturaErrorDates= ['10/04/2013', '12/04/2013','14/04/2013','16/04/2013'];
zk.afterLoad('zul.db', function(){
zul.db.Renderer.cellHTML = function (cal, y, m, d, monthofs) {
if(m == -1) {
y-= 1;
m = 11;
} else if (m == 12) {
y+= 1;
m = 0;
}
m < 10 ? month = "0" +(m + 1) : month = (m + 1);
d < 10 ? day = "0" + d : day = d;
date = day+"/"+month+"/"+ y;
if(letturaErrorDates.indexOf(date) >= 0) {
return '<div style="color: #FFFFFF;text-decoration: none;">' + day + '</div>';
} else{
return '<div style="color: red;">' + day + '</div>';
}
};
});
]]></script>
</zk>
<datebox></datebox>
<script type="text/javascript"><![CDATA[
//var letturaDates = '${dates}'
var letturaDates= ['09/03/2011', '10/03/2011'];
//alert(letturaDates);
//var letturaErrorDates = '${errorDates}'
//alert(letturaErrorDates);
var letturaErrorDates= ['10/04/2013', '12/04/2013','14/04/2013','16/04/2013'];
zk.afterLoad('zul.db', function(){
zul.db.Renderer.cellHTML = function (cal, y, m, d, monthofs) {
if(m == -1) {
y-= 1;
m = 11;
} else if (m == 12) {
y+= 1;
m = 0;
}
m < 10 ? month = "0" +(m + 1) : month = (m + 1);
d < 10 ? day = "0" + d : day = d;
date = day+"/"+month+"/"+ y;
if(letturaErrorDates.indexOf(date) >= 0) {
return '<div style="color: #FFFFFF;text-decoration: none;">' + day + '</div>';
} else{
return '<div style="color: red;">' + day + '</div>';
}
};
});
]]></script>
</zk>
Check
Demo here
No comments:
Post a Comment