Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 4th, 2012  |  syntax: None  |  size: 1.23 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <table align="center" border="1px">
  2. <tr>
  3. <th>Name</th>
  4. <th>Due</th>
  5. <th>Importance</th>
  6. <th>Other Information</th>
  7. <th>Options</th>
  8. </tr>
  9. <% @ptd.each do |ptd| %>
  10. <tr>
  11. <td align="center">
  12. <%=h ptd.name %>
  13. </td>
  14. <td align="center">
  15. <%=h ptd.due + ' ' + ptd.due1 + ', ' + ptd.due2 + ' ' + ptd.due3 + ':' + ptd.due4 + ' ' + ptd.due5 %>
  16. </td>
  17. <td align="center">
  18. <%=h '1 (Not Important)' if ptd.importance == '1' %>
  19. <%=h '2 (Important)' if ptd.importance == '2' %>
  20. <%=h '3 (Very Important)' if ptd.importance == '3' %>
  21. </td>
  22. <td align="center">
  23. <%=h truncate(ptd.other_info, 100, "...") %>
  24. </td>
  25. <td align="center">
  26. <%= link_to 'Show', ptd %> |
  27. <%= link_to 'Edit', edit_todo_path(ptd) %> |
  28. <%= link_to 'Delete', ptd, :confirm => 'Are you sure?', :method => :delete %>
  29. </td>
  30. </tr>
  31. <% end %>
  32. </table>
  33.  
  34. 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?