Is there a way to find the Visible Date range, including when it changes?

52 views
Skip to first unread message

larry_strickland

unread,
May 1, 2012, 6:34:37 PM5/1/12
to gwt-cal
I may not be approaching this the right way, but I'd rather not
retrieve all my Appointments. I'd rather like to get an event when
the visible dates change so I can fetch the necessary appointments.

larry_strickland

unread,
May 1, 2012, 6:47:13 PM5/1/12
to gwt...@googlegroups.com

doh! You tell the calendar how to change it's visible range, so you change the appointments that the same time. Sorry, my mind was clearly elsewhere.

bradr

unread,
May 1, 2012, 6:48:19 PM5/1/12
to gwt...@googlegroups.com
Hi Larry,

Remember, you (the developer) are responsible for setting the date and the date range. The calendar's date can never change without you invoking setDate, setView or setDays. So prior to invoking these functions, you can retrieve all of your events for a specified time period, and load them into the calendar.

bradr

unread,
May 1, 2012, 6:50:45 PM5/1/12
to gwt...@googlegroups.com
no worries! we've been asked this a few times. Hopefully now that it is documented in this thread it will help others if they have the same question

Larry Strickland

unread,
May 1, 2012, 6:51:53 PM5/1/12
to gwt...@googlegroups.com
Thanks Brad. I'm excited about using gwt-cal
Sent from my ASUS Eee Pad
--
You received this message because you are subscribed to the Google Groups "gwt-cal" group.
To view this discussion on the web visit https://groups.google.com/d/msg/gwt-cal/-/K0BR97MepO0J.
To post to this group, send email to gwt...@googlegroups.com.
To unsubscribe from this group, send email to gwt-cal+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gwt-cal?hl=en.

Steve Webb

unread,
Aug 8, 2012, 11:15:04 AM8/8/12
to gwt...@googlegroups.com
Hi there, I see what you are saying however isn't there a problem with this. The calendar can be told to display a month and it uses its own calculations to figure out exactly which dates to display so it may include some dates from the previous month or the next month how am I as a developer supposed to know exactly which dates it will displayed. I had assumed I could listen out for an event from the calendar indicating a display refresh was taking place and it would contain the dates which were displayed?

Maybe I'm missing something?

Thanks

Steve

bradr

unread,
Aug 8, 2012, 5:06:09 PM8/8/12
to gwt...@googlegroups.com
sorry, I was referring to the DayView. We don't expose any methods to get the "Actual Start" or "Actual Finish" of the month view, but the functions used to make these calculations are exposed

to get the first day displayed:
MonthViewDateUtils.firstDateShownInAMonthView

to get the total number of days:
MonthViewDateUtils.monthViewRequiredRows * 7

It could work something like this:
- user requests date change for MonthView (maybe via a date picker)
- get the first date displayed in the month view, using above function
- get the number of days displayed in the month view, using above function
- make ajax request to server for the date range
- receive response, populate calendar (you may need to clear previous events)
- finally update the MonthView's date, per the users request

Hopefully this can serve as a workaround until something is built into the official API

Carlos Tasada

unread,
Aug 8, 2012, 5:41:25 PM8/8/12
to gwt...@googlegroups.com
Hi Steve,

please fill an issue in the gwt-cal project with a brief request description and a proposal of the kind of API call you would expect.

Regards,
Carlos

--
You received this message because you are subscribed to the Google Groups "gwt-cal" group.
To view this discussion on the web visit https://groups.google.com/d/msg/gwt-cal/-/rwzNS50YcKsJ.

Steve Webb

unread,
Aug 9, 2012, 4:36:17 AM8/9/12
to gwt-cal
Great thanks for the response :)

I'm fairly new to GWT (actually I'm using GXT) but come from a Swing
background. I suppose I'm used to getting events when a user selects
things on a component.

Steve

Steve Webb

unread,
Aug 10, 2012, 5:06:45 AM8/10/12
to gwt-cal
Good idea I've raised issue 166.

Steve
Reply all
Reply to author
Forward
0 new messages