Loading ...
Sorry, an error occurred while loading the content.

Calander Output

Expand Messages
  • drsunno
    Hey All, I am chaning the Calendar at the moment and I have a few Questions. It would be very nice if some one could help :-) I really like the option
    Message 1 of 8 , Mar 30, 2007
    • 0 Attachment
      Hey All,

      I am chaning the Calendar at the moment and I have a few Questions.
      It would be very nice if some one could help :-)

      I really like the option preselected dates ( I am using euroean date
      format):

      YAHOO.example.calendar.cal1.select("1.03.2007-8.03.2007,18.03.2007");

      after clicking on a few dates I would like to have all dates and not
      only one date as output.
      It seams the ony way to get the dates is within the dateselected but
      if I use:
      YAHOO.example.calendar.cal1.getSelectedDates()
      it gives me all dates I clicked some dates are even double) and in a
      total different format. like "tue 15 May " etc
      Does anyone know how to get the exact output as the input I used
      above in the select statement like eg:
      1.03.2007-8.03.2007,18.03.2007

      if there is such an intelegent input where can I make the input an
      output... I am getting a little depressed :-(

      please help
      Greetings
    • Fred Janon
      I am not sure about outputting date ranges, but to get you started with the output format, there is a Javascript function to help you: var selectedDate =
      Message 2 of 8 , Mar 30, 2007
      • 0 Attachment
        I am not sure about outputting date ranges, but to get you started with the output format, there is a Javascript function to help you:
         
               var selectedDate = calendarWidget.getSelectedDates()[0];
               var dateInClientLocaleFormat = selectedDate.toLocaleDateString());

        Fred
         
        On 30 Mar 2007 00:47:05 -0700, drsunno <gido@...> wrote:

        Hey All,

        I am chaning the Calendar at the moment and I have a few Questions.
        It would be very nice if some one could help :-)

        I really like the option preselected dates ( I am using euroean date
        format):

        YAHOO.example.calendar.cal1.select("1.03.2007-8.03.2007,18.03.2007");

        after clicking on a few dates I would like to have all dates and not
        only one date as output.
        It seams the ony way to get the dates is within the dateselected but
        if I use:
        YAHOO.example.calendar.cal1.getSelectedDates()
        it gives me all dates I clicked some dates are even double) and in a
        total different format. like "tue 15 May " etc
        Does anyone know how to get the exact output as the input I used
        above in the select statement like eg:
        1.03.2007-8.03.2007,18.03.2007

        if there is such an intelegent input where can I make the input an
        output... I am getting a little depressed :-(

        please help
        Greetings


      • Satyen Desai
        Hi, getSelectedDates() should give you all the dates currently selected in the calendar, sorted, without duplicates. They will be JavaScript Date objects
        Message 3 of 8 , Mar 30, 2007
        • 0 Attachment
          Hi,
           
          getSelectedDates() should give you all the dates currently selected in the calendar, sorted, without duplicates.
           
          They will be JavaScript Date objects however - so when you try to display them, say using alert(), you'll see the default toString() implemention, which is "Tue 15 May etc."
           
          You'll need to convert these JavaScript Date objects back into a Strings which match your requirements, which is where Fred's feedback will help. You can write your own function to handle this, if JavaScript Date's toLocaleDateString() is not suitable or you need to represent ranges as strings also.
           
          * If you need help on how to write your own function to do this, please post back and we can help you out.
           
          * If you're seeing duplicate dates, can you post your code, and we can look into whether or not this is a bug.
           
          Thanks,
          Satyen

           
          ----- Original Message ----
          From: drsunno <gido@...>
          To: ydn-javascript@yahoogroups.com
          Sent: Friday, March 30, 2007 12:47:05 AM
          Subject: [ydn-javascript] Calander Output

          Hey All,

          I am chaning the Calendar at the moment and I have a few Questions.
          It would be very nice if some one could help :-)

          I really like the option preselected dates ( I am using euroean date
          format):

          YAHOO.example. calendar. cal1.select( "1.03.2007- 8.03.2007, 18.03.2007" );

          after clicking on a few dates I would like to have all dates and not
          only one date as output.
          It seams the ony way to get the dates is within the dateselected but
          if I use:
          YAHOO.example. calendar. cal1.getSelected Dates()
          it gives me all dates I clicked some dates are even double) and in a
          total different format. like "tue 15 May " etc
          Does anyone know how to get the exact output as the input I used
          above in the select statement like eg:
          1.03.2007-8. 03.2007,18. 03.2007

          if there is such an intelegent input where can I make the input an
          output... I am getting a little depressed :-(

          please help
          Greetings




          Finding fabulous fares is fun.
          Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains.
        • Gido Carper
          Hi Satyen, of course it would be cool te get some help. I don’t really have a problem with converting the Dates but for there is a function within the yahoo
          Message 4 of 8 , Mar 31, 2007
          • 0 Attachment

            Hi Satyen,

             

            of course it would be cool te get some help.

            I don’t really have a problem with converting the Dates but for there is a function within the yahoo calendar which does the opposite of what I am looking for I thought perhaps its already there and I don’t see it.


            Though a little help for a function which sorts the dates right would be very nice.

            I need a structured output even if I randomly click on the calendar the ouput should

            be: 05.03.2007-08.03.2007,15.03.2007.18.03.2007

            so the getselecteddates first should be ordered in the right way and looping through this
            ordered array it should regonizes wheter a date is a following date or not.
            this function should run on each click so it cant be too long…any suggestions?

            Double Dates I get already in the function:

            YAHOO.example.calendar.cal1.getSelectedDates()

            As soon as I click a date a few times the date will be double in the getselecteddates..

            I think it doesn’t take the selected dates but all the clicked dates I think…


            Regards

            Gido

             

             

             

             

            -----Ursprüngliche Nachricht-----
            Von: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] Im Auftrag von Satyen Desai
            Gesendet: Samstag, 31. März 2007 05:22
            An: ydn-javascript@yahoogroups.com
            Betreff: Re: [ydn-javascript] Calander Output

             

            Hi,

             

            getSelectedDates( ) should give you all the dates currently selected in the calendar, sorted, without duplicates.

             

            They will be JavaScript Date objects however - so when you try to display them, say using alert(), you'll see the default toString() implemention, which is "Tue 15 May etc."

             

            You'll need to convert these JavaScript Date objects back into a Strings which match your requirements, which is where Fred's feedback will help. You can write your own function to handle this, if JavaScript Date's toLocaleDateString( ) is not suitable or you need to represent ranges as strings also.

             

            * If you need help on how to write your own function to do this, please post back and we can help you out.

             

            * If you're seeing duplicate dates, can you post your code, and we can look into whether or not this is a bug.

             

            Thanks,

            Satyen


             

            ----- Original Message ----
            From: drsunno <gido@jingho. de>
            To: ydn-javascript@ yahoogroups. com
            Sent: Friday, March 30, 2007 12:47:05 AM
            Subject: [ydn-javascript] Calander Output

            Hey All,

            I am chaning the Calendar at the moment and I have a few Questions.
            It would be very nice if some one could help :-)

            I really like the option preselected dates ( I am using euroean date
            format):

            YAHOO.example. calendar. cal1.select( "1.03.2007- 8.03.2007, 18.03.2007" );

            after clicking on a few dates I would like to have all dates and not
            only one date as output.
            It seams the ony way to get the dates is within the dateselected but
            if I use:
            YAHOO.example. calendar. cal1.getSelected Dates()
            it gives me all dates I clicked some dates are even double) and in a
            total different format. like "tue 15 May " etc
            Does anyone know how to get the exact output as the input I used
            above in the select statement like eg:
            1.03.2007-8. 03.2007,18. 03.2007

            if there is such an intelegent input where can I make the input an
            output... I am getting a little depressed :-(

            please help
            Greetings

             

             


            Finding fabulous fares is fun.
            Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains.

          • Satyen Desai
            Hi Gido, Some feedback below... ... I am ... There s nothing really available in the Calendar API which will handle this string creation for you, so it would
            Message 5 of 8 , Apr 4, 2007
            • 0 Attachment
              Hi Gido,

              Some feedback below...

              > function within the yahoo calendar which does the opposite of what
              I am
              > looking for I thought perhaps its already there and I don't see it.

              There's nothing really available in the Calendar API which will
              handle this string creation for you, so it would need to be
              something you add on (including the range identification logic)

              > Though a little help for a function which sorts the dates right
              would be
              > very nice.

              getSelectedDates uses Array.sort with a Comparator function.

              e.g.

              datesArray.sort(function(a,b) {return a-b;});
              -or-
              datesArray.sort(function(a,b) {return a.getTime() - b.getTime();});

              But as implied, getSelectedDates should do this for you already.

              > Double Dates I get already in the function:
              >
              > YAHOO.example.calendar.cal1.getSelectedDates()
              >
              > As soon as I click a date a few times the date will be double in
              the
              > getselecteddates..

              Can you post a link to your code/url where we could see this or
              provide some relevant pieces to reproduce. I have been unable to
              reproduce this locally.

              The only use-case I know of which creates date duplicates is if
              you're using Calendar.selectCell(i) to select dates programmatically
              (which will be fixed in the next release) but I'd like to find out
              if you have a use-case which results in duplicates also.

              Thanks,
              Satyen
            • drsunno
              Hi Saytan yes unfortunetaly I am using Calendar.selectCell(i) within the code. I am using the toggle function from:
              Message 6 of 8 , Apr 5, 2007
              • 0 Attachment
                Hi Saytan

                yes unfortunetaly I am using
                Calendar.selectCell(i) within the code.
                I am using the toggle function from:
                http://tech.groups.yahoo.com/group/ydn-javascript/message/8642

                and some other functions wich use selectCell
                Okay I will have to find a way around it.
                Thanks!

                Regards
                Gido

                --- In ydn-javascript@yahoogroups.com, "Satyen Desai" <sdezzi@...>
                wrote:
                >
                > Hi Gido,
                >
                > Some feedback below...
                >
                > > function within the yahoo calendar which does the opposite of
                what
                > I am
                > > looking for I thought perhaps its already there and I don't see
                it.
                >
                > There's nothing really available in the Calendar API which will
                > handle this string creation for you, so it would need to be
                > something you add on (including the range identification logic)
                >
                > > Though a little help for a function which sorts the dates right
                > would be
                > > very nice.
                >
                > getSelectedDates uses Array.sort with a Comparator function.
                >
                > e.g.
                >
                > datesArray.sort(function(a,b) {return a-b;});
                > -or-
                > datesArray.sort(function(a,b) {return a.getTime() - b.getTime();});
                >
                > But as implied, getSelectedDates should do this for you already.
                >
                > > Double Dates I get already in the function:
                > >
                > > YAHOO.example.calendar.cal1.getSelectedDates()
                > >
                > > As soon as I click a date a few times the date will be double in
                > the
                > > getselecteddates..
                >
                > Can you post a link to your code/url where we could see this or
                > provide some relevant pieces to reproduce. I have been unable to
                > reproduce this locally.
                >
                > The only use-case I know of which creates date duplicates is if
                > you're using Calendar.selectCell(i) to select dates
                programmatically
                > (which will be fixed in the next release) but I'd like to find out
                > if you have a use-case which results in duplicates also.
                >
                > Thanks,
                > Satyen
                >
              • Satyen Desai
                Thanks for the validation. The fix for selectCell will be pushed out in the next release. Regards, Satyen
                Message 7 of 8 , Apr 5, 2007
                • 0 Attachment
                  Thanks for the validation. The fix for selectCell will be pushed out
                  in the next release.

                  Regards,
                  Satyen
                • Satyen Desai
                  Hi, The following thread discusses a workaround for the selectCell bug which you can look at: http://tech.groups.yahoo.com/group/ydn- javascript/message/9325
                  Message 8 of 8 , Apr 5, 2007
                  • 0 Attachment
                    Hi,

                    The following thread discusses a workaround for the selectCell bug
                    which you can look at: http://tech.groups.yahoo.com/group/ydn-
                    javascript/message/9325

                    Also as mentioned, a fix for it will be pushed out with the next YUI
                    release.

                    Regards,
                    Satyen
                  Your message has been successfully submitted and would be delivered to recipients shortly.