Use strftime to format date and datetimes
This commit is contained in:
@@ -227,7 +227,7 @@ defmodule MusicLibrary.Records.Record do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def format_as_date(purchased_at) do
|
def format_as_date(dt) do
|
||||||
"#{purchased_at.day}/#{purchased_at.month}/#{purchased_at.year}"
|
Calendar.strftime(dt, "%d/%m/%Y")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ defmodule MusicLibrary.ScrobbleActivity do
|
|||||||
|> DateTime.from_unix!()
|
|> DateTime.from_unix!()
|
||||||
|> DateTime.shift_zone!(timezone)
|
|> DateTime.shift_zone!(timezone)
|
||||||
|
|
||||||
"#{ldt.day}/#{ldt.month}/#{ldt.year} #{ldt.hour}:#{ldt.minute}"
|
Calendar.strftime(ldt, "%d/%m/%Y %X")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp recent_release_ids(recent_tracks) do
|
defp recent_release_ids(recent_tracks) do
|
||||||
|
|||||||
Reference in New Issue
Block a user