DateChooser .. disable year and month?

I want the user to DateChooserallow the user to select a date in this month and year. I want to set the month and year programmatically and allow the user to select a date / day.

I can do this easily in a year by setting minYear and maxYear in any year I want, but I don’t see a breakthrough way to prevent the user from choosing another month?

+3
source share
4 answers

Here's how you turn off the month selection arrows ... a common CSS hacker !!

nextMonthUpSkin: ClassReference('mx.skins.Border');
nextMonthDisabledSkin: ClassReference('mx.skins.Border');
nextMonthDownSkin: ClassReference('mx.skins.Border');
nextMonthOverSkin: ClassReference('mx.skins.Border');
prevMonthUpSkin: ClassReference('mx.skins.Border');
prevMonthDisabledSkin: ClassReference('mx.skins.Border');
prevMonthDownSkin: ClassReference('mx.skins.Border');
prevMonthOverSkin: ClassReference('mx.skins.Border');   

I apologize for not seeing this issue in August. But I recently (yesterday) had the same problem and found this solution ... cheers.

+2
source

JabbyPanda, DateChooser. , . , , , fwdMonthButton, backMonthButton, , visible false. :

import mx.controls.DateChooser;
import mx.core.mx_internal;
use namespace mx_internal;

public class MyDateChooser extends DateChooser
{
    override protected function createChildren():void {
        super.createChildren();
        // Remove them:
        this.removeChild(this.mx_internal::fwdMonthButton);
        this.removeChild(this.mx_internal::backMonthButton);
        // Or just hide them:
        //this.mx_internal::fwdMonthButton.visible = false; 
        //this.mx_internal::backMonthButton.visible = false;    
    }
}
+2

selectableRange rangeStart rangeEnd . , 1 2010 15 2010 :

selectableRange="{{rangeStart:new Date(2010,7,1), rangeEnd:new Date(2010,7,15)}}"

, ( ). , .

+1

mx: DateChooser "yearNavigationEnabled"

If you want to disable monthly navigation, you will have to switch from the standard DateChooser component and implement the "monthNavigationEnabled" functionality, similar to the existing "yearNavigationEnabled"

+1
source

Source: https://habr.com/ru/post/1757668/


All Articles