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