Summit-Events-App icon indicating copy to clipboard operation
Summit-Events-App copied to clipboard

Feed viewStart/viewEnd arguments are ignored

Open GardinerMatt opened this issue 4 years ago • 2 comments

image

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

GardinerMatt avatar Oct 22 '20 03:10 GardinerMatt

@tcdahlberg @jimhubert @GardinerMatt

Did this get resolved or still outstanding?

rdblake21 avatar Feb 08 '21 18:02 rdblake21

@tcdahlberg Can you address this one?

rdblake21 avatar Oct 26 '21 02:10 rdblake21

@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.

tcdahlberg avatar Jan 29 '24 22:01 tcdahlberg