30
Jul
07

Changing the calendar layout in the DateChooser component using the firstDayOfWeek parameter

A brief example of changing the first day of the week for the DateChooser control using the firstDayOfWeek property.

Full code after the jump.

View MXML

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white">

    <mx:Script>
        <![CDATA[
            private var dayNames:Array = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

            private function getDayName(item:Number):String {
                return dayNames[item];
            }
        ]]>
    </mx:Script>

    <mx:DateChooser todayColor="red" firstDayOfWeek="{slider.value}"/>

    <mx:VBox>
        <mx:Label text="First day of week:" />
        <mx:HSlider id="slider" minimum="0" maximum="6" liveDragging="true" snapInterval="1" dataTipFormatFunction="getDayName" />
    </mx:VBox>

</mx:Application>

View source enabled in the following example


0 Responses to “Changing the calendar layout in the DateChooser component using the firstDayOfWeek parameter”


  1. No Comments

Leave a Reply

This blog is terrible at eating HTML tags. If you plan on posting code/XML, please escape your "<" characters as "&lt;" and your ">" characters as "&gt;".




July 2007
M T W T F S S
    Aug »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Badge Farm

  • Firefox 2
  • Powered by Redoable 1.2
  • Feeds burnt by Feedburner
  • Feed