
Untitled
By: a guest on
May 4th, 2012 | syntax:
None | size: 1.23 KB | hits: 9 | expires: Never
<table align="center" border="1px">
<tr>
<th>Name</th>
<th>Due</th>
<th>Importance</th>
<th>Other Information</th>
<th>Options</th>
</tr>
<% @ptd.each do |ptd| %>
<tr>
<td align="center">
<%=h ptd.name %>
</td>
<td align="center">
<%=h ptd.due + ' ' + ptd.due1 + ', ' + ptd.due2 + ' ' + ptd.due3 + ':' + ptd.due4 + ' ' + ptd.due5 %>
</td>
<td align="center">
<%=h '1 (Not Important)' if ptd.importance == '1' %>
<%=h '2 (Important)' if ptd.importance == '2' %>
<%=h '3 (Very Important)' if ptd.importance == '3' %>
</td>
<td align="center">
<%=h truncate(ptd.other_info, 100, "...") %>
</td>
<td align="center">
<%= link_to 'Show', ptd %> |
<%= link_to 'Edit', edit_todo_path(ptd) %> |
<%= link_to 'Delete', ptd, :confirm => 'Are you sure?', :method => :delete %>
</td>
</tr>
<% end %>
</table>
I want to make it so that if the current time is within 1 hour of ptd.due + ' ' + ptd.due1 + ' ' + ptd.due2 + ' ' + ptd.due3 + ':' + ptd.due4 + ' ' + ptd.due5 (which spits out a value like "July 04 2010 3:03 PM") then the <tr> (from line 11 to line 31) will blink the color #FF0000 until ptd.due + ' ' + ptd.due1 + ' ' + ptd.due2 + ' ' + ptd.due3 + ':' + ptd.due4 + ' ' + ptd.due5 equals the current time. How would I do this?