You are here

calendar-month.html.twig in Calendar 8

Same filename and directory in other branches
  1. 8.2 templates/calendar-month.html.twig

Template to display a view as a calendar month.

Available variables:

  • day_names: An array of the day of week names for the table header.
  • rows: An array of data for each day of the week.
  • view: The view.
  • calendar_links: Array of formatted links to other calendar displays - year, month, week, day.
  • display_type: year, month, day, or week.
  • block: Whether or not this calendar is in a block.
  • min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
  • max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
  • date_id: a css id that is unique for this date, it is in the form: calendar-nid-field_name-delta

File

templates/calendar-month.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Template to display a view as a calendar month.
  5. *
  6. * Available variables:
  7. * - day_names: An array of the day of week names for the table header.
  8. * - rows: An array of data for each day of the week.
  9. * - view: The view.
  10. * - calendar_links: Array of formatted links to other calendar displays - year, month, week, day.
  11. * - display_type: year, month, day, or week.
  12. * - block: Whether or not this calendar is in a block.
  13. * - min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
  14. * - max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
  15. * - date_id: a css id that is unique for this date, it is in the form: calendar-nid-field_name-delta
  16. *
  17. * @ingroup themeable
  18. */
  19. #}
  20. <div class="calendar-calendar"><div class="month-view">
  21. <table class="full">
  22. <thead>
  23. <tr>
  24. {% for cell in day_names %}
  25. <th class="{{ cell.class }}" id="{{ cell.header_id }}">
  26. {{ cell.data }}
  27. </th>
  28. {% endfor %}
  29. </tr>
  30. </thead>
  31. <tbody>
  32. {% for row in rows %}
  33. {{ row.data }}
  34. {% endfor %}
  35. </tbody>
  36. </table>
  37. </div></div>
  38. <!--
  39. todo decide what we will do with this.
  40. <script>
  41. try {
  42. // ie hack to make the single day row expand to available space
  43. if ($.browser.msie ) {
  44. var multiday_height = $('tr.multi-day')[0].clientHeight; // Height of a multi-day row
  45. $('tr[iehint]').each(function(index) {
  46. var iehint = this.getAttribute('iehint');
  47. // Add height of the multi day rows to the single day row - seems that 80% height works best
  48. var height = this.clientHeight + (multiday_height * .8 * iehint);
  49. this.style.height = height + 'px';
  50. });
  51. }
  52. }catch(e){
  53. // swallow
  54. }
  55. </script>-->