Skip to content

Commit

Permalink
feat(slack): Add abbreviated name of day to Slack message (#72)
Browse files Browse the repository at this point in the history
* feat(slack): add abbreviated name of day to slack message

see: https://hexdocs.pm/calendar/Calendar.Strftime.html

* test(slack): update test to match newly added abbreviated name of day to slack message

---------

Co-authored-by: Marcelo Dominguez <[email protected]>
  • Loading branch information
oscartorres-10 and marpo60 authored Jan 29, 2025
1 parent a14e43b commit 92cc1c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/meetup_bot/slack.ex
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ defmodule MeetupBot.Slack do
end

defp to_bullet_item(meetup) do
"• #{Calendar.strftime(meetup.datetime, "%-d %B - %H:%M")} - <#{meetup.event_url}|#{escaped_text(meetup.name)}>"
"• #{Calendar.strftime(meetup.datetime, "%a, %-d %B - %H:%M")} - <#{meetup.event_url}|#{escaped_text(meetup.name)}>"
end

defp escaped_text(text) do
Expand Down
2 changes: 1 addition & 1 deletion test/slack_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defmodule SlackTest do
},
{
"type": "section",
"text": {"type": "mrkdwn", "text": "• 28 March - 22:00 - <http://example.com|Elixir |&gt; Meetup>"}
"text": {"type": "mrkdwn", "text": "• Thu, 28 March - 22:00 - <http://example.com|Elixir |&gt; Meetup>"}
}
]
}
Expand Down

0 comments on commit 92cc1c7

Please sign in to comment.