Yancy icon indicating copy to clipboard operation
Yancy copied to clipboard

Calendar controller

Open preaction opened this issue 7 years ago • 0 comments

The Yancy::Controller::Yancy::Calendar contains actions to display items containing calendar event information:

This controller will have all the actions from Yancy::Controller::Yancy and the following new ones:

  • month - A month view of events
    • Takes the following configuration:
      • collection - The collection to view
      • start_field - The field in the item containing the event's start date/time in ISO8601 format
      • end_field - (optional) The field in the item containing the event's end date/time in ISO8601 format
      • year - The year to view (four-digit year)
      • month - The month to view (number, 01-12)
    • Creates the following stash values for templates
      • days - An array of hashes of day information including the following keys:
        • date - A Time::Piece object containing the date information, including year, month, and day
        • items - The events that start, end, or cross this day
  • week - A week view of events
    • Takes the following configuration
      • collection - The collection to view
      • start_field - The field in the item containing the event's start date/time in ISO8601 format
      • end_field - (optional) The field in the item containing the event's end date/time in ISO8601 format
      • year - The year to view (four-digit year)
      • month - The month to view (number, 01-12)
      • day - The day to start showing the week of events (number, 00-31)
    • Creates the following stash values for templates
      • hours - An array of hashes of hour information including the following keys:
        • hour - A Time::Piece object containing the date information, including year, month, day, and hour
        • items - The events that start, end, or cross this hour
  • day - A day view of events
    • Takes the following configuration
      • collection - The collection to view
      • start_field - The field in the item containing the event's start date/time in ISO8601 format
      • end_field - (optional) The field in the item containing the event's end date/time in ISO8601 format
      • year - The year to view (four-digit year)
      • month - The month to view (number, 01-12)
      • day - The day to view (number, 00-31)
    • Creates the following stash values for templates
      • hours - An array of hashes of hour information including the following keys:
        • hour - A Time::Piece object containing the date information, including year, month, day, and hour
        • items - The events that start, end, or cross this hour

An example application should be added to eg/ to demonstrate this controller.

preaction avatar Jan 21 '19 03:01 preaction