From f645869d282490f88996c47f9a65c4e27725cd04 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sun, 8 Dec 2019 01:11:16 -0500 Subject: [PATCH] use awarded_on for sort --- lib/philomena/badges/award.ex | 2 +- lib/philomena_web/views/profile_view.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/philomena/badges/award.ex b/lib/philomena/badges/award.ex index a71bce2f..9b0a8a36 100644 --- a/lib/philomena/badges/award.ex +++ b/lib/philomena/badges/award.ex @@ -11,7 +11,7 @@ defmodule Philomena.Badges.Award do belongs_to :badge, Badge field :label, :string - field :awarded_on, :naive_datetime + field :awarded_on, :utc_datetime field :reason, :string field :badge_name, :string diff --git a/lib/philomena_web/views/profile_view.ex b/lib/philomena_web/views/profile_view.ex index 5344e755..d4888032 100644 --- a/lib/philomena_web/views/profile_view.ex +++ b/lib/philomena_web/views/profile_view.ex @@ -2,7 +2,7 @@ defmodule PhilomenaWeb.ProfileView do use PhilomenaWeb, :view def award_order(awards) do - Enum.sort_by(awards, &{!&1.badge.priority, &1.created_at}) + Enum.sort_by(awards, &{!&1.badge.priority, &1.awarded_on}) end def badge_image(badge, options \\ []) do