1. #1
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    20
    Vote Rating
    0
    steven.wong is on a distinguished road

      0  

    Default Unanswered: DateField MaxValue and MinValue

    Unanswered: DateField MaxValue and MinValue


    I'm trying to enforce a date range logic on two DateFields. the OnValueChange event for each, sets the min and max values the DateField can have. Simply put, DateField FROM's onValueChange event would set DateField TO's minValue to whatever FROM's value is. Vice versa for TO's onValueChange would set the FROM's maxValue.

    The problem I'm coming up with is that both DateFields can't be the same value, I get a validation error. How do I make it so that the TO value is ">=" the minValue and the FROM value is "<=" the maxValue?

    Please let me know if you need more clarification.

    Code:
                final DateField fromValue = new DateField();
                fromValue.addValidator( new EmptyValidator<Date>() );
                
                final DateField toValue = new DateField();
                toValue.addValidator( new EmptyValidator<Date>() );
                
                fromValue.addValueChangeHandler( new ValueChangeHandler<Date>() {
                    
                    @Override
                    public void onValueChange(ValueChangeEvent<Date> event) {
                        toValue.setMinValue( event.getValue() );
                    }
                    
                });
                
                toValue.addValueChangeHandler( new ValueChangeHandler<Date>() {
    
    
                    @Override
                    public void onValueChange(ValueChangeEvent<Date> event) {
                        fromValue.setMaxValue( event.getValue() );
                    }
                    
                });
    when inspecting your MinDateValidator for your DateField, I noticed that you use Date.before() function, so it doesn't really allow for "same" date validity.
    -->

  2. #2
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    20
    Vote Rating
    0
    steven.wong is on a distinguished road

      0  

    Default


    nevermind... thats basically "EQUALS" not date range, so whats the point.
    -->

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar