From bc03a26d4b475d28cd770a34697f49e862853188 Mon Sep 17 00:00:00 2001 From: Luka Murn Date: Thu, 12 Jan 2017 15:06:12 +0100 Subject: [PATCH] Also fix this new year issue on comments display --- app/views/my_module_comments/_list.html.erb | 6 +++--- app/views/project_comments/_list.html.erb | 6 +++--- app/views/result_comments/_list.html.erb | 6 +++--- app/views/step_comments/_list.html.erb | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/views/my_module_comments/_list.html.erb b/app/views/my_module_comments/_list.html.erb index cf4076d1b..627d9d6cd 100644 --- a/app/views/my_module_comments/_list.html.erb +++ b/app/views/my_module_comments/_list.html.erb @@ -1,10 +1,10 @@ <% day = 0 %> -<% current_day = DateTime.current.strftime('%j').to_i %> +<% current_day = days_since_1970(DateTime.current) %> <% comments.each do |comment| %> - <% comment_day = comment.created_at.strftime('%j').to_i %> + <% comment_day = days_since_1970(comment.created_at) %> <% if comment_day <= current_day && comment_day > day %> - <% day = comment.created_at.strftime('%j').to_i %> + <% day = days_since_1970(comment.created_at) %>
  • <%= comment.created_at.strftime('%d.%m.%Y') %>

  • diff --git a/app/views/project_comments/_list.html.erb b/app/views/project_comments/_list.html.erb index d40a3bdd3..fd3a8f646 100644 --- a/app/views/project_comments/_list.html.erb +++ b/app/views/project_comments/_list.html.erb @@ -1,9 +1,9 @@ <% day = 0 %> -<% current_day = DateTime.current.strftime('%j').to_i %> +<% current_day = days_since_1970(DateTime.current) %> <% comments.each do |comment| %> - <% comment_day = comment.created_at.strftime('%j').to_i %> + <% comment_day = days_since_1970(comment.created_at) %> <% if comment_day <= current_day && comment_day > day %> - <% day = comment.created_at.strftime('%j').to_i %> + <% day = days_since_1970(comment.created_at) %>
  • <%= comment.created_at.strftime('%d.%m.%Y') %>

  • diff --git a/app/views/result_comments/_list.html.erb b/app/views/result_comments/_list.html.erb index 3d4bd6e7d..37529b929 100644 --- a/app/views/result_comments/_list.html.erb +++ b/app/views/result_comments/_list.html.erb @@ -1,10 +1,10 @@ <% day = 0 %> -<% current_day = DateTime.current.strftime('%j').to_i %> +<% current_day = days_since_1970(DateTime.current) %> <% comments.each do |comment| %> - <% comment_day = comment.created_at.strftime('%j').to_i %> + <% comment_day = days_since_1970(comment.created_at) %> <% if comment_day <= current_day && comment_day > day %> - <% day = comment.created_at.strftime('%j').to_i %> + <% day = days_since_1970(comment.created_at) %>
  • <%= comment.created_at.strftime('%d.%m.%Y') %>

  • diff --git a/app/views/step_comments/_list.html.erb b/app/views/step_comments/_list.html.erb index 6dcb9e0ed..2865f3fb8 100644 --- a/app/views/step_comments/_list.html.erb +++ b/app/views/step_comments/_list.html.erb @@ -1,10 +1,10 @@ <% day = 0 %> -<% current_day = DateTime.current.strftime('%j').to_i %> +<% current_day = days_since_1970(DateTime.current) %> <% comments.each do |comment| %> - <% comment_day = comment.created_at.strftime('%j').to_i %> + <% comment_day = days_since_1970(comment.created_at) %> <% if comment_day <= current_day && comment_day > day %> - <% day = comment.created_at.strftime('%j').to_i %> + <% day = days_since_1970(comment.created_at) %>
  • <%= comment.created_at.strftime('%d.%m.%Y') %>