I have a class that contains events and their start dates. I need to retrieve all records by grouping them so that the first few days are listed at a time. Example:
2014-01-01, 2014-02-01, 2014-03-01, 2014-01-02, 2014-02-02, 2014-03-02, ...
I need these results, to set up the structure of a calendar. Any help is welcome.
Follow the class.
class Headline
include Mongoid::Document
include Mongoid::Timestamps
field :start_date, type: Date
field :end_date, type: Date
end