use awarded_on for sort

This commit is contained in:
byte[] 2019-12-08 01:11:16 -05:00
parent caaeb3ad2e
commit f645869d28
2 changed files with 2 additions and 2 deletions

View file

@ -11,7 +11,7 @@ defmodule Philomena.Badges.Award do
belongs_to :badge, Badge belongs_to :badge, Badge
field :label, :string field :label, :string
field :awarded_on, :naive_datetime field :awarded_on, :utc_datetime
field :reason, :string field :reason, :string
field :badge_name, :string field :badge_name, :string

View file

@ -2,7 +2,7 @@ defmodule PhilomenaWeb.ProfileView do
use PhilomenaWeb, :view use PhilomenaWeb, :view
def award_order(awards) do 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 end
def badge_image(badge, options \\ []) do def badge_image(badge, options \\ []) do