     }
     
     // generate objects to populate a SpinnerList with dates, e.g. "1, 2, 3, ... 31"
-    private function generateMonthOfDates():IList
+    private function generateMonthOfDates(today:Date):IList
     {
         var ac:ArrayCollection = new ArrayCollection();
-        
-        var dtf:DateTimeFormatter = dateTimeFormatter;
-        dtf.dateTimePattern = "d";
-        
-        // choosing January 1980 to guarantee 31 days in the month
-        var d:Date = new Date(1980, 0, 1, 0, 1, 0, 0);
-		var today:Date = new Date();
-		 
+        var todayDate:int = today.getDate();
+        
+        dateTimeFormatter.dateTimePattern = dateTimeFormatterEx.getDayOfMonthPattern();
+        
+        // guarantee 31 days in the month
+        dateObj.time = JAN1980_IN_MS;
+        
         for (var i:int = 1; i <= 31; i++)
         {
-            d.date = i;
-            var item:Object = generateDateItemObject(dtf.format(d), i);
-			
-			if(i == today.getDate())
-				item["accentColor"] = getStyle("accentColor");
+            dateObj.date = i;
+            var item:Object = generateDateItemObject(dateTimeFormatter.format(dateObj), i);
+
+			if (i == todayDate)
+                item["accentColor"] = getStyle("accentColor");
 		
             ac.addItem(item);
         }

            if (displayMode == DateSelectorDisplayMode.DATE_AND_TIME)
            {
                dateList.dataProvider = new DateAndTimeRangeList(minDate, maxDate,
                    localeStr, new Date(), getStyle("accentColor"));
                
                // set size to longest string
                dateList.typicalItem = {label:"Wed May 31"}; // TODO: localize? better way to do this? add a dot? ask Masa
            }
            else
            {
                dateList.dataProvider = generateMonthOfDates();
                
                // set size to width of longest visible value
                dateList.typicalItem = getLongestLabel(dateList.dataProvider);

        if (refreshDateTimeFormatter)
        {
            if (localeStr)
            {
                dateTimeFormatterEx.setStyle("locale", localeStr);
                dateTimeFormatter.setStyle("locale", localeStr);
            }
            else
            {
                dateTimeFormatterEx.clearStyle("locale");
                dateTimeFormatter.clearStyle("locale");
            }
            
            use24HourTime = dateTimeFormatterEx.getUse24HourFlag();
            refreshDateTimeFormatter = false;
        }
        
        // an array of the list and position objects that will be sorted by position
        var fieldPositionObjArray:ArrayCollection = new ArrayCollection();
        var listSort:ISort = new Sort();
        listSort.fields = [new SortField("position")];
        fieldPositionObjArray.sort = listSort;

        // ==================================================
        // switch out lists if the display mode changed
        if (displayModeChanged)
        {
            // clean out the container and all existing lists
            // they may be in different positions, which will affect how they
            // need to be (re)created
            cleanContainer();
            
            var fieldPosition:int = 0;
            var listItem:Object;
            var tempList:SpinnerList;
            var numItems:int;
            
            // configure the correct lists to use
            if (displayMode == DateSelectorDisplayMode.TIME ||
                displayMode == DateSelectorDisplayMode.DATE_AND_TIME)
            {
                fieldPositionObjArray.addItem(generateFieldPositionObject(HOUR_ITEM, dateTimeFormatterEx.getHourPosition()));
                fieldPositionObjArray.addItem(generateFieldPositionObject(MINUTE_ITEM, dateTimeFormatterEx.getMinutePosition()));
                
                if (displayMode == DateSelectorDisplayMode.DATE_AND_TIME)
                    fieldPositionObjArray.addItem(generateFieldPositionObject(DATE_ITEM, dateTimeFormatterEx.getMonthPosition()));
                
                if (!use24HourTime)
                    fieldPositionObjArray.addItem(generateFieldPositionObject(MERIDIAN_ITEM, dateTimeFormatterEx.getAmPmPosition()));
                
                // sort fieldPosition objects by position               
                fieldPositionObjArray.refresh();
                
                numItems = fieldPositionObjArray.length;
                
                for each (listItem in fieldPositionObjArray)
                {
                    switch(listItem.dateItem)
                    {
                        case HOUR_ITEM:
                        {
                            hourList = createDateItemList(HOUR_ITEM, fieldPosition++, numItems);
                            tempList = hourList;
                            break;
                        }
                        case MINUTE_ITEM:
                        {
                            minuteList = createDateItemList(MINUTE_ITEM, fieldPosition++, numItems);
                            tempList = minuteList;
                            break;
                        }
                        case MERIDIAN_ITEM:
                        {
                            meridianList = createDateItemList(MERIDIAN_ITEM, fieldPosition++, numItems);
                            tempList = meridianList;
                            break;
                        }	
                        case DATE_ITEM:
                        {
                            dateList = createDateItemList(DATE_ITEM, fieldPosition++, numItems);
                            tempList = dateList;
                            break;
                        }
                    }
                    tempList.addEventListener(IndexChangeEvent.CHANGE, dateItemList_changeHandler);
                    listContainer.addElement(tempList);
                }
            }
            else // default case: DATE mode
            {
                fieldPositionObjArray.addItem(generateFieldPositionObject(MONTH_ITEM, dateTimeFormatterEx.getMonthPosition()));
                fieldPositionObjArray.addItem(generateFieldPositionObject(DATE_ITEM, dateTimeFormatterEx.getDayOfMonthPosition()));
                fieldPositionObjArray.addItem(generateFieldPositionObject(YEAR_ITEM, dateTimeFormatterEx.getYearPosition()));

                // sort fieldPosition objects by position 
                fieldPositionObjArray.refresh();
                
                numItems = fieldPositionObjArray.length;
                
                for each (listItem in fieldPositionObjArray)
                {
                    switch(listItem.dateItem)
                    {
                        case MONTH_ITEM:
                        {
                            monthList = createDateItemList(MONTH_ITEM, fieldPosition++, numItems);
                            tempList = monthList;
                            break;
                        }
                        case DATE_ITEM:
                        {
                            dateList = createDateItemList(DATE_ITEM, fieldPosition++, numItems);
                            tempList = dateList;
                            break;
                        }
                        case YEAR_ITEM:
                        {
                            yearList = createDateItemList(YEAR_ITEM, fieldPosition++, numItems);
                            tempList = yearList;
                            break;
                        }	
                    }
                    tempList.addEventListener(IndexChangeEvent.CHANGE, dateItemList_changeHandler);
                    listContainer.addElement(tempList);
                }
                // set item renderers prototype
                // yearList.itemRenderer = new ClassFactory(DefaultDateSpinnnerItemRendererThingy);
            }
            displayModeChanged = false;
            listsCreated = true;
        }

        // ==================================================
        var today:Date = new Date();
        
        // populate lists that are being shown
        if (yearList && populateYearDataProvider)
        {
            yearList.dataProvider = generateYears(today);
            //			yearList.dataProvider = new YearRangeList(localeStr, minDate.fullYear, maxDate.fullYear);
            populateYearDataProvider = false;
            
