<div class="easy-calendar-header">
	<%= render :partial => 'common/calendar_listing_links', :locals => {:period => :month, :calendar => easy_user_working_time_calendar} -%>
</div>
<div class="easy-calendar">
  <table class="easy-user-working-time-calendar cal">
    <thead>
      <tr>
        <th scope="col" title="<%= l(:label_week) %>" class="week-number"></th>
        <% 7.times do |i| %>
          <th scope="col"><%= day_name( (easy_user_working_time_calendar.first_wday+i)%7 ) %></th>
        <% end %>
      </tr>
    </thead>
    <tbody>
      <tr>
        <% day = easy_user_working_time_calendar.startdt
        while day <= easy_user_working_time_calendar.enddt -%>
          <%= "<td class='week-number' title='#{ l(:label_week) }'>#{(day+(11-day.cwday)%7).cweek}</td>".html_safe if day.cwday == easy_user_working_time_calendar.first_wday %>
          <% holiday = easy_user_working_time_calendar.holiday(day) -%>
          <td id="<%= day.to_s.underscore -%>" class="<%= day.month == easy_user_working_time_calendar.month ? 'even' : 'odd' %><%= ' today' if User.current.today == day %><%= ' weekend' if easy_user_working_time_calendar.weekend?(day) -%><%= ' holiday' unless holiday.nil? -%><%= ' exception' if easy_user_working_time_calendar.exception?(day) -%>">
            <%= render :partial => 'easy_user_working_time_calendars/inline_show', :locals => {:day => day, :easy_user_working_time_calendar => easy_user_working_time_calendar} -%>
          </td>
          <%= '</tr><tr>'.html_safe if day.cwday == easy_user_working_time_calendar.last_wday && day != easy_user_working_time_calendar.enddt %>
          <% day = day + 1
        end -%>
      </tr>
    </tbody>
  </table>
</div>
<div class="easy-user-working-time-calendar-explanatory-notes legend">
  <span class="legend-label"><%= l(:label_easy_user_working_time_calendar_explanatory_notes) %></span>
  <span class="legend-item"><%= l(:label_easy_user_working_time_calendar_explanatory_notes_default) -%></span>
  <span class="legend-item today"><%= l(:label_easy_user_working_time_calendar_explanatory_notes_today) -%></span>
  <span class="legend-item weekend"><%= l(:label_easy_user_working_time_calendar_explanatory_notes_weekend) -%></span>
  <span class="legend-item holiday"><%= l(:label_easy_user_working_time_calendar_explanatory_notes_holiday) -%></span>
  <span class="legend-item exception"><%= l(:label_easy_user_working_time_calendar_explanatory_notes_exception) -%></span>
</div>