Summit-Events-App
Summit-Events-App copied to clipboard
Feed viewStart/viewEnd arguments are ignored
I couldn't figure out why the feed without using fullcalendar.io was giving me events that had already happened when I was passing in the viewStart argument with today's date. It turns out that it is always being overridden by the ?start value or a generated date from a month ago.
Easy to solve by just passing in ?start instead of ?viewStart but it doesn't seem intentional
@tcdahlberg @jimhubert @GardinerMatt
Did this get resolved or still outstanding?
@tcdahlberg Can you address this one?
@rdblake21 and @GardinerMatt ,
This has been fixed wit this code:
if (String.isNotBlank(req.params.get('viewStart'))) {
viewStart = Date.valueOf(String.escapeSingleQuotes(req.params.get('viewStart')));
}
//if fullcalendar in use start is passed. start being protected variable
if (String.isNotBlank(req.params.get('start'))) {
viewStart = Date.valueOf(req.params.get('start'));
} else if (viewStart == null) {
viewStart = Datetime.newInstance(Date.today(), Time.newInstance(0, 0, 0, 0)).addMonths(-1);
}
Specifically this:
} else if (viewStart == null) {
Now it checks if viewStart is null before defaulting the date for minus a month.