0

GXT 3 - DateField date selection in a month

I want make the datefield to just allow selection in a month only.


DateField dateField = new DateField(new DateTimePropertyEditor(DateTimeFormat.getFormat("dd-MMM-yyyy")));

String sDate=session.getIps_year().toString() + "-" + session.getIps_month().toString() + "-01";        
Date mindate =Application.mysqlDateTimeFormat.parse(sDate);
dateField.setMinValue(mindate);    
dateField.getDatePicker().setMinDate(mindate);

Date maxdDate=CalendarUtil.copyDate(mindate);
CalendarUtil.addMonthsToDate(maxdDate, 1);
int days= CalendarUtil.getDaysBetween(mindate, maxdDate);
maxdDate=CalendarUtil.copyDate(mindate);
CalendarUtil.addDaysToDate(maxdDate, days-1);
dateField.setMaxValue(maxdDate);    
dateField.getDatePicker().setMaxDate(maxdDate);

0

GXT 3 Date Field Min & Max Date

I want to set min dan max date for datefield and want it disable the selection of dates out of specified range.

DateField dateField = new DateField(new DateTimePropertyEditor(DateTimeFormat.getFormat("dd-MMM-yyyy")));
dateField.getDatePicker().setMinDate(mindate);
dateField.getDatePicker().setMaxDate(maxdDate);
        
 
Copyright © peyotest