Joel

I had to implement something similar last year and you are right, its a bit 
of a palaver to implement, I had to do it in a control on the page and 
would pass in the full list of events as an property (XML string).

* read the list of events into sortable structure (I used a .Net 
List<Event> where Event is my class including a Date)
* implement a date sorter that gets items in the srrtable list greater than 
today, and limited by number. ( I used a LINQ query as follows)

            var varResults = (
                        from a
                            in Data.Items
                            where a.ItemDate >= m_dateToday
                            orderby a.ItemDate ascending
                            select a
                        ).Take(2); // the number of events to show from this 
date


a caveat is this the number of results may return 0.

Stu Wilson

On Thursday, 13 December 2012 20:24:24 UTC, Joel Kinzel wrote:
>
> I feel like I've asked this question before, but perhaps it was just to 
> Jian a while back.
>
> We have a problem in which customers want only the next N events from 
> today to show up. Obviously we can sort by date, but the problem is that 
> dates in the future show up, instead of dates from today forward. If we 
> sort the opposite way, dates from the past are listed instead. We are 
> currently using pre-execute to add events to a custom "event" class list, 
> and then using the date property of that class to sort and eliminate items 
> from the list. We then loop over the list and print it out accordingly. 
>
> To me that seems like an awful lot of work. Is there something we are 
> missing where we can achieve this functionality without pre-execute or 
> JavaScript?
>

-- 
You received this message because you are subscribed to the Google Groups 
"RedDot CMS Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/reddot-cms-users/-/A7eNYcdCuKwJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/reddot-cms-users?hl=en.

Reply via email to