I was having a problem with the calendars:each tag. Trying to loop through each calendar and display the first event. Turns out that the calendars tag is setting tag.locals.calendars to all calendars and then later on when you go to get events, it's using:
tag.locals.calendars ||= set_calendars(tag)
So it's always getting events for all calendars rather than the current calendar in the cycle.
My simple solution was to change these tags:
tag 'calendars' do |tag|
# -removed- tag.locals.calendars ||= set_calendars(tag)
tag.expand
end
tag 'calendars:each' do |tag|
result = []
set_calendars(tag).each do |cal| #changed this line
tag.locals.calendar = cal
result << tag.expand
end
result
end
I was having a problem with the calendars:each tag. Trying to loop through each calendar and display the first event. Turns out that the calendars tag is setting tag.locals.calendars to all calendars and then later on when you go to get events, it's using:
So it's always getting events for all calendars rather than the current calendar in the cycle.
My simple solution was to change these tags:
now it works for me.