about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-01-26 23:13:48 +0100
committerEugen Rochko <eugen@zeonfederated.com>2020-01-26 23:13:48 +0100
commit42d2a915e4aa31533032e37aaa46354cee2386da (patch)
treeb8022ad85fed21d21ed0f6e307d24f60dbe5eb07 /app/serializers
parent401f32f9eedf9f41c097ee01c1f6203eae568663 (diff)
Change last_status_at to be a date, not datetime (#12966)
* Return last_status_at as date, not datetime

* Fix relative timestamp for dates when delay is inferior to 1 day

* Also fix public directory

* Fix error when last_status_at isn't set
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/rest/account_serializer.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb
index fd361a34c..0db1916b0 100644
--- a/app/serializers/rest/account_serializer.rb
+++ b/app/serializers/rest/account_serializer.rb
@@ -55,4 +55,8 @@ class REST::AccountSerializer < ActiveModel::Serializer
   def moved_and_not_nested?
     object.moved? && object.moved_to_account.moved_to_account_id.nil?
   end
+
+  def last_status_at
+    object.last_status_at&.to_date&.iso8601
+  end
 end