mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-22 16:16:34 +00:00
Use :utc_datetime
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
0b16ce79f9
commit
597f56b4c4
4 changed files with 6 additions and 6 deletions
|
@ -1463,8 +1463,8 @@ defmodule Pleroma.User do
|
|||
|
||||
expires_at =
|
||||
if expires_in > 0 do
|
||||
NaiveDateTime.utc_now()
|
||||
|> NaiveDateTime.add(expires_in)
|
||||
DateTime.utc_now()
|
||||
|> DateTime.add(expires_in)
|
||||
else
|
||||
nil
|
||||
end
|
||||
|
|
|
@ -18,7 +18,7 @@ defmodule Pleroma.UserRelationship do
|
|||
belongs_to(:source, User, type: FlakeId.Ecto.CompatType)
|
||||
belongs_to(:target, User, type: FlakeId.Ecto.CompatType)
|
||||
field(:relationship_type, Pleroma.UserRelationship.Type)
|
||||
field(:expires_at, :naive_datetime)
|
||||
field(:expires_at, :utc_datetime)
|
||||
|
||||
timestamps(updated_at: false)
|
||||
end
|
||||
|
|
|
@ -7,7 +7,7 @@ defmodule Pleroma.Repo.Migrations.AddExpiresAtToUserRelationships do
|
|||
|
||||
def change do
|
||||
alter table(:user_relationships) do
|
||||
add_if_not_exists(:expires_at, :naive_datetime)
|
||||
add_if_not_exists(:expires_at, :utc_datetime)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -646,9 +646,9 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
|
|||
mute_expires_at: mute_expires_at
|
||||
} = AccountView.render("show.json", %{user: other_user, for: user, mutes: true})
|
||||
|
||||
assert NaiveDateTime.diff(
|
||||
assert DateTime.diff(
|
||||
mute_expires_at,
|
||||
NaiveDateTime.utc_now() |> NaiveDateTime.add(24 * 60 * 60)
|
||||
DateTime.utc_now() |> DateTime.add(24 * 60 * 60)
|
||||
) in -3..3
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue