0

I am a java developer. I have developing one web application related with holiday activity. I am using GWT datepicker. How can i disable click event and don't show the past month day & next month day in the current month datepicker. I am disabled the previous & next button in the datepicker but when i click the next & past day in the current datepicker, it will navigate the selected month.

My Screen Shot:

enter image description here

Expected Result:

enter image description here

In my expected result marked yellow color is the unwanted day in the specific datepicker (no need to show) otherwise disable the click event to the specific day in the datepicker and how can i integrate CellGridImpl in my code.

code:

fTableLayout.setWidget(2, 0, datePicker);
    fTableLayout.setWidget(2, 1, getDatePicker(year + "-02-01"));
    fTableLayout.setWidget(2, 2, getDatePicker(year + "-03-01"));
    fTableLayout.setWidget(2, 3, getDatePicker(year + "-04-01"));
    fTableLayout.setWidget(3, 0, getDatePicker(year + "-05-01"));
    fTableLayout.setWidget(3, 1, getDatePicker(year + "-06-01"));

public DatePicker getDatePicker (String date) {
    DatePicker datePicker = new DatePicker();
    DateTimeFormat format = DateTimeFormat.getFormat("yyyy-MM-dd");
    datePicker.setCurrentMonth(format.parse(date));
    datePicker.addStyleName("my-cal");
    return datePicker;
}

Thanks in advance.

Mukul Kant
  • 7,074
  • 5
  • 38
  • 53
Kannan Arumugam
  • 1,119
  • 2
  • 18
  • 27

1 Answers1

0

There are many answers available for this. Here are few of them

http://c.gwt-examples.com/home/ui/datepicker

How to limit the available Date ranges with the com.google.gwt.user.datepicker.client.DateBox

Community
  • 1
  • 1
Abhijith Nagaraja
  • 3,370
  • 6
  • 27
  • 55