             return list.getItemAt(idx);
         
         return null;
+    }
+    
+    private function updateListsToSelectedDate(listsNewlyCreated:Boolean):void
+    {
+        var newIndex:int;
+        if (yearList)
+        {
+            // TODO: use math for the year instead of iterating through each one; remove that function
+            newIndex = findDateItemIndexInDataProvider(selectedDate.fullYear, yearList.dataProvider);
+            goToIndex(yearList, newIndex, listsNewlyCreated);
+        }
+        
+        if (monthList)
+            goToIndex(monthList, selectedDate.month, listsNewlyCreated);
+        
+        if (dateList)
+        {
+            if (displayMode == DateSelectorDisplayMode.DATE)
+            {
+                goToIndex(dateList, selectedDate.date - 1, listsNewlyCreated);
+            }
+            else // DATE_AND_TIME mode
+            {
+                newIndex = findDateIndex(selectedDate, dateList.dataProvider);
+                goToIndex(dateList, newIndex, listsNewlyCreated);
+            }
+        }
+        if (hourList)
+        {
+            // TODO: double-check the math
+            newIndex = use24HourTime ? selectedDate.hours : (selectedDate.hours + 11) % 12;
+            goToIndex(hourList, newIndex, listsNewlyCreated);
+        }
+        if (minuteList)
+        {
+            // TODO: calculate instead of iterate?
+            newIndex = findDateItemIndexInDataProvider(selectedDate.minutes, minuteList.dataProvider);
+            goToIndex(minuteList, newIndex, listsNewlyCreated);
+        }
+        if (!use24HourTime && meridianList)
+        {
+            newIndex = selectedDate.hours < 12 ? 0 : 1;
+            goToIndex(meridianList, newIndex, listsNewlyCreated);
+        }
+        
+        dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
     }
     
     // modify existing date item spinner list data providers to mark

            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;
            
            yearList.typicalItem = getLongestLabel(yearList.dataProvider);
        }
        if (monthList && populateMonthDataProvider)
        {
            monthList.dataProvider = generateMonths(today);
            populateMonthDataProvider = false;
            
            // set size
            monthList.typicalItem = getLongestLabel(monthList.dataProvider);
        }
        if (dateList && populateDateDataProvider)
        {
            if (displayMode == DateSelectorDisplayMode.DATE_AND_TIME)
            {
                dateList.dataProvider = new DateAndTimeRangeList(minDate, maxDate,
                    localeStr, today, getStyle("accentColor"));
                
                // set size to longest string
                dateList.typicalItem = dateList.dataProvider.getItemAt(0); // TODO: localize? better way to do this? add a dot? ask Masa
            }
            else
            {
                dateList.dataProvider = generateMonthOfDates(today);
                
                // set size to width of longest visible value
                dateList.typicalItem = getLongestLabel(dateList.dataProvider);
            }
            
            populateDateDataProvider = false;
        }
        if (hourList && populateHourDataProvider)
        {
            hourList.dataProvider = generateHours(use24HourTime);
            hourList.typicalItem = getLongestLabel(hourList.dataProvider);
            populateHourDataProvider = false;
        }
        if (minuteList && populateMinuteDataProvider)
        {
            minuteList.dataProvider = generateMinutes();
            minuteList.typicalItem = getLongestLabel(minuteList.dataProvider);
            populateMinuteDataProvider = false;
        }
        if (meridianList && populateMeridianDataProvider)
        {
            var amObject:Object = generateAmPm(AM);
            var pmObject:Object = generateAmPm(PM);
            meridianList.dataProvider = new ArrayCollection([amObject, pmObject]);
            meridianList.typicalItem = getLongestLabel(meridianList.dataProvider);
            populateMeridianDataProvider = false;
        }
        
        // ==================================================
        
        // correct any integrity violations
        if (minDateChanged || maxDateChanged || syncSelectedDate || listsCreated || minuteStepSizeChanged)
        {        
            // check min <= max
            if (minDate.time > maxDate.time)

        return days;
    }
    
    // clean out the container: remove all elements, detach event listeners, null out references
    private function cleanContainer():void
    {
        listContainer.removeAllElements();
