Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar controller #51

Open
preaction opened this issue Jan 21, 2019 · 0 comments
Open

Calendar controller #51

preaction opened this issue Jan 21, 2019 · 0 comments

Comments

@preaction
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant