Datechooser disabledRanges using DB

Ask a Question related to Macromedia Flash Data Integration, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. DateChooser
      Hi, Iam using Adobe Flex 2 ...I working on datechooser control .actually my Requirement is Just like Microsoft project plane type . When I...
    2. 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.
    3. Dnd of datechooser
      I want to add dnd functionality to datechooser. Does anyone already did this ? Cheers, Ed
    4. 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...
    5. 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...
  3. #2

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139