<div class="bs_calendar">
  <%
    if date_range.is_a?(Array)
      date = date_range[0]
      date_object = [ date ]

      while(date.to_s != date_range[1].to_s)
        option = {year: date.year, month: date.month, day: date.day, wday: date.wday}
        date = NepaliCalendar::BsCalendar.travel 1, option
        date_object << date
      end
    end
  %>

  <%= link_to '&laquo; Previous'.html_safe, start_date: travel(-1, date_range[0]) %>
  <%= "#{start_date.month_name}, #{start_date.year}" %>
  <%= link_to 'Next &raquo;'.html_safe, start_date: travel(1, date_range[1]) %>
  <table class="table table-stripped">
    <thead>
      <tr>
        <th>Aitabar</th>
        <th>Sombar</th>
        <th>Mangalbar</th>
        <th>Budhbar</th>
        <th>Bihibar</th>
        <th>Sukrabar</th>
        <th>Sanibar</th>
      </tr>
    </thead>

    <tbody>
      <%
        date_object.each_slice(7) do |week|
      %><tr><%
        week.each do |day|
      %>
          <td>
            <%= day.day %>
          </td>
      <%
          end
        end
      %>
    </tbody>
  </table>
</div>

<div class="bs_calendar">
  <%
    if date_range.is_a?(Array)
      date = date_range[0]
      date_object = [ date ]

      while(date.to_s != date_range[1].to_s)
        option = {year: date.year, month: date.month, day: date.day, wday: date.wday}
        date = NepaliCalendar::BsCalendar.travel 1, option
        date_object << date
      end
    end
  %>

  <%= link_to '&laquo; Previous'.html_safe, start_date: travel(-1, date_range[0]) %>
  <%= "#{start_date.month_name}, #{start_date.year}" %>
  <%= link_to 'Next &raquo;'.html_safe, start_date: travel(1, date_range[1]) %>
  <table class="table table-stripped">
    <thead>
      <tr>
        <% NepaliCalendar::BsCalendar::DAYNAMES[1..7].each do |day| %>
          <th><%= day %></th>
        <% end %>
      </tr>
    </thead>

    <tbody>
      <%
        date_object.each_slice(7) do |week|
      %><tr><%
        week.each do |day|
      %>
          <td>
            <% block.call day %>
          </td>
      <%
          end
        end
      %>
    </tbody>
  </table>
</div>

Call block on view helper
Call block on view helper
