3 Replies Latest reply: Mar 19, 2010 3:42 PM by Flex harUI RSS

    can you customise DateChooser to select a week, instead of day?

    cyber0897 Community Member

      hey guys, so quick weird question, im trying to create a calender type thing for my application where if the user clicks on a given day it selects that week, and then changes that given panel to have a group of information?

       

      so i basically need to change the "DateChooser" to when you hover over a date, the entire week highlights, and if you click on that week it gives you an array of the days in the week.

       

      any ideas??

       

      thank you in advance

        • 1. Re: can you customise DateChooser to select a week, instead of day?
          Flex harUI Adobe Employee

          There is a mockup of a Spark based DateChooser on my blog.  You might want

          to start from there.

           

          --

          Alex Harui

          Flex SDK Team

          Adobe System, Inc.

          http://blogs.adobe.com/aharui

          • 2. Re: can you customise DateChooser to select a week, instead of day?
            cyber0897 Community Member

            ahh, i went through your blog, thank you

             

            i actually started out with the following code, it seems to be working... i basically have the week highlited... i was wondering if there is a way i could possibly animate the dateChooser, where if the user selects the week, everything gets minimised and the week kinda floats to the top of the app, and then the user would be able to click on each date individually, at which time i would display a form right below the week...

             

            i hope im making sense... its going ot be sort of like a scheduler, but for a different purpose

             

             

            thanks you alex for the quick response

             

            <s:HGroup height="100%" width="100%">
                 <s:Group height="100%" width="100%">
                      <mx:DateChooser width="100%" height="100%" change="selectWeek(DateChooser(event.target))" />
                 </s:Group>
            </s:HGroup>
            

             

            public function selectWeek(calendar:DateChooser) :void
            {
                 var sd:Date = calendar.selectedDate
                 var dayUTC:Number = 86400000;
                 // check if sunday (first day of civil week)
                 var sd_sun:Date = sd;
                 if (sd.day != 0) 
                 {
                      sd_sun = new Date(sd.valueOf() - sd.day * dayUTC);
                 }
                 var sd_sat:Date = new Date(sd_sun.valueOf() + 6 * dayUTC);
                 calendar.selectedRanges = [{rangeStart: sd_sun, rangeEnd: sd_sat}];
            }
            
            
            • 3. Re: can you customise DateChooser to select a week, instead of day?
              Flex harUI Adobe Employee

              Sounds like it might take some effort, but most things are possible.  You

              might want to change states to a buttonbar of the week and different art for

              the minimized stuff.  Good luck.