mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 22:27:59 +01:00
use awarded_on for sort
This commit is contained in:
parent
caaeb3ad2e
commit
f645869d28
2 changed files with 2 additions and 2 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue