{# @description daisyUI's calendar, drawn by Cally: a date picker for one date, or a range with range, over one month or several. Your project loads Cally and nothing shows until it does, because this package ships no script; the README shows the script tag for a pinned version. Cally reads value, min, max, locale, first-day-of-week and its other attributes from the calendar element, and they pass through unchanged. The previous and next buttons hold an icon and a visually hidden name, so they are named Previous and Next; pass icon classes through previous_icon and next_icon, or shadow the icon component with one that resolves names, since without either the buttons show nothing but are still named. A chosen date is read from the value of the calendar in its change event, and the README shows the few lines that copy it into a hidden form input. See the fieldset gallery entry for a single date with a minimum and maximum and a two-month range. #} {# @prop range:boolean | description:"Choose a range of dates, drawn by Cally's calendar-range, instead of a single date." #} {# @prop months:select['1','2','3'] | default:"1" | description:"How many months show side by side. Paging moves by that many. Anything that is not a positive whole number shows one." #} {# @prop previous_icon:text | default:"chevron-left" | description:"Icon of the previous month button, passed to the icon component as its name; use icon classes such as bi bi-chevron-left unless your project's icon component resolves names." #} {# @prop next_icon:text | default:"chevron-right" | description:"Icon of the next month button, passed to the icon component as its name; use icon classes such as bi bi-chevron-right unless your project's icon component resolves names." #} {# @prop class:text | description:"Extra classes added to the calendar." #} {% load i18n daisy_cotton %} {% count_range months 1 as offsets %} {# djlint:off #} {% if range %} 1 %} months="{{ offsets|length }}"{% endif %} {{ attrs }}>{% for offset in offsets %}{% endfor %}{% if range %}{% else %}{% endif %} {# djlint:on #}