Flex 3 Custom DateChooser

I searched so much about a custom DateChooser component in Flex 3, that I decided to make one by myself. My criteria is to have ComboBoxes for both months and years. I simply merged the ComboBox component with DateChooser and there is the beta release. Please fill free to comment and report any bugs or feature requests.

Demo is here:

Free download: here

12 thoughts on “Flex 3 Custom DateChooser

  1. Great component , i am searching for this for long time.

    But i cannot download source. error shows page not found.

    i need this component urgently.

    Please help …

  2. Hi Very nice example.

    How can we do the same for datefield.

    Means year and month dropdown in dateField?

    thanks in advance.

    Regards,
    Srinivas

  3. Hey can you tell me how would I highlight multiple dates in the Flex3 datechooser. And access individual textfields of the datechooser in Flex3 ??

    thanks

  4. Hi,
    I’m pretty sure this is well described in the Flex 3 documentation, what I’m not sure is the right syntax, so you can check what’s present out in the web.

    regards,
    stoimen

  5. @Srinivas
    to create a CustomDateField you must create a CustomDateChooser and set it in the dropDownFactory variable.
    Hi i took the liberty to create a DateChooser component using this code i fixed some bugs it had regarding changing the months in the DateChooser while having the combobox opened. I also added the selectableRange capability and used a special combobox component to disable the unselectable months, you can find it here.
    http://wmcai.blog.163.com/blog/static/4802420088945053961/

    –CustomDateChooser–

    = yearStart) {
    yearStart = (selectableRange.rangeStart as Date).fullYear;
    monthStart = (selectableRange.rangeStart as Date).month;
    }
    if (selectableRange
    && selectableRange.rangeEnd
    && (selectableRange.rangeEnd as Date).fullYear <= yearEnd) {
    yearEnd = (selectableRange.rangeEnd as Date).fullYear;
    monthEnd = (selectableRange.rangeEnd as Date).month;
    }
    for (var year:int = yearStart; year <= yearEnd; year++) {
    yearsArray.push(year);
    }
    addChild(months);
    addChild(years);

    update();

    // register some event listeners
    addEventListener(DateChooserEvent.SCROLL, onChangeMonth);
    months.addEventListener(Event.CHANGE, onChangeDropDownMonth);
    months.addEventListener(DropdownEvent.CLOSE, onDropDownClose);
    years.addEventListener(Event.CHANGE, onChangeDropDownYears);
    years.addEventListener(DropdownEvent.CLOSE, onDropDownClose);
    }

    public function update():void {
    months.selectedIndex = displayedMonth;
    years.selectedItem = displayedYear;
    if (displayedYear == yearEnd) {
    for (var a:int = monthEnd +1; a <= 11; a++) {
    monthsArray[a].enabled = false;
    }
    } else if (displayedYear == yearStart) {
    for (var b:int = 0; b < monthStart; b++) {
    monthsArray[b].enabled = false;
    }
    } else {
    for (var c:int = 0; c monthEnd) {
    displayedMonth = monthEnd;
    }
    } else if (years.selectedItem == yearStart) {
    if (displayedMonth

  6. @Srinivas
    to create a CustomDateField you must create a CustomDateChooser and set it in the dropDownFactory variable.
    Hi i took the liberty to create a DateChooser component using this code i fixed some bugs it had regarding changing the months in the DateChooser while having the combobox opened. I also added the selectableRange capability and used a special combobox component to disable the unselectable months, you can find it here.
    http://wmcai.blog.163.com/blog/static/4802420088945053961/

    the component can be downloaded here i hope the creator of this blog to upload this version and give Weimin Cai the honors for this great combobox

    http://rapidshare.com/files/368231876/CustomDateChooser.rar.html

Leave a Reply

Your email address will not be published. Required fields are marked *