Tag Archive for 'daynamesshort'

20
Dec

Setting the first day of the week in a Flex DateField control’s calendar

The following example shows how you can set the firstDayOfWeek property on the Flex DateField control to control whether the pop-up calendar starts on a Sunday (default) or a different day of the week.

Full code after the jump.

Continue reading ‘Setting the first day of the week in a Flex DateField control’s calendar’

11
Dec

Using the DateBase class in Flex

We’ve looked briefly at the DateBase class before, “Setting the DateChooser control’s dayNames property and firstDayOfWeek property”, but considering how often dates/calendars come up in Flex, it is always good to remind people that they don’t need to reinvent the wheel (or date constants, as the case may be).

The following examples shows how you can use the various static properties in the DateBase class (shown below) to populate ComboBox controls (or any other control with a data provider).

  • dayNamesShort — “Sun”, …, “Sat”
  • dayNamesLong — “Sunday”, …, “Saturday”
  • monthNamesShort — “Jan”, …, “Dec”
  • monthNamesLong — “January”, …, “December”
  • timeOfDay — “AM”, “PM”

Full code after the jump.

Continue reading ‘Using the DateBase class in Flex’

23
Aug

Setting the DateChooser control’s dayNames property and firstDayOfWeek property

This is kind of silly, but I was looking through the DateBase class today and figured “why not?”. This example takes a quick look at setting the DateChooser control’s dayNames property and switching between the default values (”S”, “M”, “T”, …, “S”) with the longer versions such as “Sun”, “Mon”, “Tue”, …, “Sat”, and the longer/sillier still “Sunday”, “Monday”, “Tuesday”, …, “Saturday”.

The one interesting thing to note in this example though, is even though you can change the firstDayOfWeek property to control the day first of the week that the calendar starts on, the dayNames array should always start with Sunday.

Full code after the jump.

Continue reading ‘Setting the DateChooser control’s dayNames property and firstDayOfWeek property’