EZCalendar v0.1.5 EZCalendar.HTML.Navigation

Functions to render calendar navigation links.

For easy access to all the render functions add EZCalendar.HTML to your view.

defmodule MyApp.ShiftView do
  use MyApp.Web, :view
  import EZCalendar.HTML
end

If you only want the navigation links you can import EZCalendar.HTML.Navigation instead.

Summary

Functions

Renders a HTML link for the next calendar

Renders a HTML link for the previous calendar

Functions

calendar_next(calendar, path, content \\ nil)

Renders a HTML link for the next calendar.

Takes a calendar struct and a string to format the path from as arguments.

Placeholders :day, :month and :year will be replaced with the corresponding params.

<%= calendar_next @calendar, "/events/:year/:month/:day" %>

<%= calendar_next @calendar, "/events?year=:year&month=:month" %>

Takes a string or function as an optional third arugment.

<%= calendar_next @calendar, "/events/:year/:month", "Next" %>

<%= calendar_next @calendar, "/events/:year/:month", fn()-> %>
  Next
<% end %>
calendar_prev(calendar, path, content \\ nil)

Renders a HTML link for the previous calendar.

Used the same as calendar_next/3