Skip to content

Commit

Permalink
Fix wrong timestamp in saved message
Browse files Browse the repository at this point in the history
  • Loading branch information
MMore committed Mar 14, 2021
1 parent c82d53d commit 751baed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defmodule SSIExport.Parser do
defp parse_saved_message(message) do
saved_message = %DataAdapter.SavedMessage{
channel_id: message["channel"],
date_created: DateTime.from_unix!(message["date_create"]),
date_created: convert_slack_timestamp_to_datetime(message["message"]["ts"]),
message_id: message["message"]["ts"],
permalink: message["message"]["permalink"],
text: parse_message_text(message["message"]["text"]),
Expand Down
6 changes: 3 additions & 3 deletions test/parser_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defmodule ParserTest do
channel_id: "G2YTXSK1S",
channel_name: nil,
channel_type: nil,
date_created: ~U[2021-03-13 10:49:50Z],
date_created: ~U[2021-03-05 17:31:37Z],
message_id: "1614965497.000400",
permalink: "https://example.slack.com/archives/G2YTXSK1S/p1614965497000400",
replies: [],
Expand All @@ -46,7 +46,7 @@ defmodule ParserTest do
%DataAdapter.SavedMessage{
channel_id: "C1VUNGG7L",
channel_name: nil,
date_created: ~U[2021-02-24 18:13:16Z],
date_created: ~U[2021-02-24 10:48:56Z],
message_id: "1614163736.005600",
permalink: "https://example.slack.com/archives/C1VUNGG7L/p1614163736005600",
replies: [],
Expand All @@ -56,7 +56,7 @@ defmodule ParserTest do
%DataAdapter.SavedMessage{
channel_id: "C0LV45YRJ",
channel_name: nil,
date_created: ~U[2021-02-22 10:09:46Z],
date_created: ~U[2021-02-19 15:35:35Z],
message_id: "1613748935.045000",
permalink: "https://example.slack.com/archives/C0LV45YRJ/p1613748935045000",
replies: [],
Expand Down

0 comments on commit 751baed

Please sign in to comment.