title: How to get Date only on a DateTime attribute? working on a calendar
body: <p>I am working with a Calendar and I think that calendar deals only with date without a time.</p>
  
  <p>Note: <em>requested_date is a <strong>DateTime</strong> Attribute</em>. I want to get all reservations with requested date and covert it to date only:</p>
  
  <p><strong>users_controller.rb</strong></p>
  
  <pre><code>def myprofile
      @reservation = Reservation.all
      @resv_by_date = @reservation.group_by(&amp;:requested_date) &lt;-- make requested_date to date only
  end
  </code></pre>
  
  <p><strong>myprofile.html.erb</strong></p>
  
  <pre><code>&lt;div id="admin"&gt;
  &lt;%= calendar do |date| %&gt;
      &lt;%= date.day %&gt;&lt;br&gt;
          &lt;%  @resv_by_date.each do |reservation| %&gt;
          &lt;%= reservation.requested_date.to_date  %&gt;&lt;br&gt;
      &lt;% end %&gt;
  &lt;% end %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/tZZzV.png" rel="nofollow noreferrer"><em>(this month 'May') requested_date is existing on my database</em></a>
  <img src="https://i.stack.imgur.com/tZZzV.png" alt="(this month &#39;May&#39;) requested_date is existing on my database"></p>
  
  <p><a href="https://i.stack.imgur.com/5TKsF.png" rel="nofollow noreferrer"><em>image output after the solution of the 1st answer</em></a>
  <img src="https://i.stack.imgur.com/5TKsF.png" alt="image output after the solution of the 1st answer"></p>