Ask a Question related to Macromedia Flash Data Integration, Design and Development.
-
cinthyamr #1
Datechooser disabledRanges using DB
Hello every body.
Someone can help me?.
I need only a little bit to finish something that I am doing.
I make a calendar, using Flash and AmfPHP, the calendar load the reservations
informations in a MySql table. After the flash movie, takes the information
relating to the reserved days of the calendar, and then, the calendar would
have to take the information of the MySQL table, the column of (date visits)
for deactivate, the previous selected date by others users.
I´m using this code:
Either how I have to pass the information stored in the table (Date Visits),
to the calendar in order that it deactivates the dates stored in the database?.
In advance I am grateful to them for all those who could help me.
_global.inactivos = new Array();//I declare the variable that it will contain
the dates of the reserved days.
if (data) {//I take the stored information in the MySQL table, and
//if the consult is correct.
for (b=0; b<data.getLength(); b++) { // Data contains the information of
several tables, but only I am interested in the table, (Date_Visits).
stringb = unescape(data.getItemAt(b).Fecha_Visita);// I select only the
information of the column of dates of visits.
cortado = stringb.split("/");
diarestado = cortado[0];
mesrestado = cortado[1]-1;
anorestado = cortado[2];
inactivos.addItem(["new Date ("+anorestado+","+mesrestado+","+diarestado+")"]);
}
trace (inactivos);\\ The debugger shows: new Date (2008,4,19),new Date
(2008,5,16),new Date (2008,6,21),new Date (2008,7,18),new Date (2008,8,22),new
Date (2008,9,20),new Date (2008,10,17) // This does not work.
//Whenever I select the calendar, I use this:
My_DateChooser.disabledRanges = [new Date(evento.target.selectedDate)]; //
This works.
//When I activate and turn visible the calendar, I realize the following
operation.
flightDateChooser.disabledRanges = [inactivos]; // But it does not work.
flightDateChooser.disabledRanges = [new
Date(evento.target.selectedDate),inactivos]; //Of this one, only works the
evento.target.SelectedDate.
The case is that I need to make a dates table, who guards the information in a
database, and later use them to deactivate days of a DateChooser Component.
//If I add the Items to the variable inactivos of the following way:
inactivos.addItem([new Date (anorestado,mesrestado,diarestado)]);
//The debugger shows: Mon May 19 00:00:00 GMT-0400 2008,Mon Jun 16 00:00:00
GMT-0400 2008,Mon Jul 21 00:00:00 GMT-0400 2008,Mon Aug 18 00:00:00 GMT-0400
2008,Mon Sep 22 00:00:00 GMT-0400 2008,Mon Oct 20 00:00:00 GMT-0300 2008,Mon
Nov 17 00:00:00 GMT-0300 2008
//But of this form it does not work.
cinthyamr Guest
-
DateChooser
Hi, Iam using Adobe Flex 2 ...I working on datechooser control .actually my Requirement is Just like Microsoft project plane type . When I... -
DateChooser Scroll
Is it possible to hide or remove the scroll thumbs from a dateChooser ui component? I want to lock the component to a single month. -
Dnd of datechooser
I want to add dnd functionality to datechooser. Does anyone already did this ? Cheers, Ed -
How to creat my own DateChooser?
Hi all: I am trying to creat my own DateChooser which can navigate by year. But I tried a lot on my own class which inherited from... -
dateChooser unSelected Value ?
Hi I am a beginner in Flex and actionscript. sorry, if the question seems a little... stupid... is there anyway to get the value when I... -
perillan #2
Re: Datechooser disabledRanges using DB
Hola cinthyamr, yo ten?a el mismo problema y la solucion me la distes t?.
Prueba esto:
Espero que te sirva..
Un saludo
var dRanges = new Array(); // contendr? el objeto con rangeStart y rangeEnd
for(i:Number= 0; i<id_sala_array.length; i++){
if (id_sala_array[i] == sala) {
var f_ini:Date = cambiafecha(feini_array[i]); //fecha utilizada para
rangeStart
var f_fin:Date = cambiafecha(fefin_array[i]);//fecha utilizada para rangeEnd
// creo vars : anioi, mesi, diai, aniof, mesf, diaf
para montar el new Date()
var anioi:Number = f_ini.getFullYear();
if (f_fin.getMonth()<10) {
mesi = "0"+(f_ini.getMonth()-1);
} else {
mesi = f_ini.getMonth()-1;
}
var diai:Number = f_ini.getDate();
var iDate = new Date(anioi,mesi,int(diai));
////////////////////////
var aniof:Number = f_fin.getFullYear();
if (f_fin.getMonth()<10) {
mesf = "0"+(f_fin.getMonth()-1);
} else {
mesf = f_fin.getMonth()-1;
}
var diaf:Number = f_fin.getDate();
// nuevas pruebas
var fDate = new Date(aniof,mesf,int(diaf));
dRanges.push({rangeStart: iDate, rangeEnd: fDate});
//fin nuevas pruebas
}
}
// esto funciona
contecal_mc.calendario_dc.disabledRanges = dRanges;
perillan Guest



Reply With Quote

