From 2abfbf4f94832c393f76414c691658050f952a04 Mon Sep 17 00:00:00 2001 From: Nuno Miguel Date: Thu, 19 Sep 2024 19:01:35 +0100 Subject: [PATCH] refactor: clean-up hours function --- .../live/calendar_live/components/week.ex | 30 ++----------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/lib/atomic_web/live/calendar_live/components/week.ex b/lib/atomic_web/live/calendar_live/components/week.ex index 4f54bf1d..692c59fc 100644 --- a/lib/atomic_web/live/calendar_live/components/week.ex +++ b/lib/atomic_web/live/calendar_live/components/week.ex @@ -258,31 +258,7 @@ defmodule AtomicWeb.CalendarLive.Components.CalendarWeek do end end - defp hours, - do: [ - "0H", - "1H", - "2H", - "3H", - "4H", - "5H", - "6H", - "7H", - "8H", - "9H", - "10H", - "11H", - "12H", - "13H", - "14H", - "15H", - "16H", - "17H", - "18H", - "19H", - "20H", - "21H", - "22H", - "23H" - ] + defp hours do + 0..23 |> Enum.map(fn n -> "#{n}H" end) + end end