Issue 14 in gwt-datepicker: There's no way to filter the daterange

2 views
Skip to first unread message

codesite...@google.com

unread,
Jul 28, 2009, 6:12:33 PM7/28/09
to gwt-dat...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 14 by dvbeek: There's no way to filter the daterange
http://code.google.com/p/gwt-datepicker/issues/detail?id=14

I can't seem to find a simple way to add a daterange or filter to the
datepicker.

For example;
Often there is no use in selecting dates older than the current date.
You want to limit the picker by disabling the day's before the current day,
and disabling the 'previous month'-button.

At this point I have overridden the DatePicker and copied the
DefaultMonthPicker (because it's final) to my personal class, and changed
the refresh-function as follows;
[code]
protected void refresh() {
String formattedMonth = getModel().formatCurrentMonth(); //@see
DefaultMonthSelector#refresh()
grid.setText(0, 1, formattedMonth); //@see
DefaultMonthSelector#refresh()
Date cal = new Date();
int currentMonth = cal.getMonth();
cal = getDatePicker().getCurrentMonth();
int visibleMonth = cal.getMonth();
if (currentMonth == visibleMonth) {
backwards.setVisible(false);
} else {
backwards.setVisible(true);
}
}
[/code]
...to remove the 'previous month'-button.

Shouldn't there be a simpler way to do this, or am I missing something?
(I'm jusing getting started with GWT, don't shoot me if say something
stupid)

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply all
Reply to author
Forward
0 new messages