Skip to content

Commit 35e34b5

Browse files
committed
fix weird datetime
1 parent 18d46f0 commit 35e34b5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/mod_invites_sql.erl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ list_invites(Host) ->
156156
inviter = {User, Host},
157157
type = dec_type(Type),
158158
account_name = AccountName,
159-
expires = Expires,
160-
created_at = CreatedAt}
159+
expires = to_datetime(Expires),
160+
created_at = to_datetime(CreatedAt)}
161161
end, Rows).
162162

163163
num_account_invites(User, Server) ->
@@ -187,6 +187,11 @@ datetime_to_sql_timestamp({{Year, Month, Day}, {Hour, Minute, Second}}) ->
187187
sql_now() ->
188188
datetime_to_sql_timestamp(calendar:local_time()).
189189

190+
to_datetime({Date, {H, M, S, _}}) ->
191+
{Date, {H, M, S}};
192+
to_datetime(DateTime) ->
193+
DateTime.
194+
190195
enc_type(roster_only) -> <<"R">>;
191196
enc_type(account_subscription) -> <<"S">>;
192197
enc_type(account_only) -> <<"A">>.

0 commit comments

Comments
 (0)