//Window.alert(String.valueOf(inicioreal));
lista_dia = (Date)inicioreal.clone();
Rectangle base;
Text txt;
Text txtmes;
int dia_tipo = 0;
String color = "teal";
int dia_diciembre = 0;
int fin = contarDias(inicioreal, finreal);
//int fin2 = calendario.getDaysBetween(inicioreal, finreal);
if(fin<0){
finreal.setYear(finreal.getYear()+1);
fin = contarDias(inicioreal, finreal);
}
//Window.alert("inicio " + String.valueOf(inicioreal));
//Window.alert("fin " + String.valueOf(finreal));
//Window.alert("Dias totales " + String.valueOf(fin));
//Window.alert("Dias totales 2 " + String.valueOf(fin2));
canvas.setWidth((fin*20)+20);
//for(int i=0; i<100; i++){
for(int i=0; i<=fin; i++){
if(lista_dia.getDate()==1 || (i==0 && lista_dia.getDate() <=24)){
txtmes = new Text((i*20)+5,31+margen,darMes(lista_dia.getMonth())+ " 20" + String.valueOf(lista_dia.getYear()-100));
txtmes.setFontSize(14);
canvas.add(txtmes);
}
dia_tipo = lista_dia.getDay();
if(dia_tipo == 0 || dia_tipo == 6){
color = "#6c84ed";
base = new Rectangle(i*20,53+margen,18,350);
base.setFillOpacity(0.2);
base.setStrokeOpacity(0.3);
base.setStrokeColor(color);
base.setFillColor(color);
canvas.add(base);
}
else{
color = "teal";
}
if(contarDias(lista_dia, hoy)==0){
base = new Rectangle(i*20,53+margen,18,350);
base.setFillOpacity(0.3);
base.setStrokeOpacity(0.3);
base.setStrokeColor("#facc2e");
base.setFillColor("#facc2e");
canvas.add(base);
}
base = new Rectangle(i*20,34+margen,18,18);
base.setFillOpacity(0.0);
base.setStrokeOpacity(0.5);
base.setStrokeColor(color);
canvas.add(base);
String dia = String.valueOf(lista_dia.getDate());
if(dia.length()==1)
dia = "0"+dia;