We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46ff55f commit 34f58ffCopy full SHA for 34f58ff
lib/recurring_events/by_pump.ex
@@ -104,7 +104,10 @@ defmodule RecurringEvents.ByPump do
104
defp inflate_by_month(date, %{by_month: months}) do
105
Stream.map(months, fn month ->
106
day = @date_helper.last_day_of_the_month(%{date | month: month})
107
- %{date | month: month, day: min(day, date.day)}
+ month_shift = month - date.month
108
+ new_date = date |> @date_helper.shift_date(month_shift, :months)
109
+ day_shift = min(day, date.day) - new_date.day
110
+ new_date |> @date_helper.shift_date(day_shift, :days)
111
end)
112
end
113
0 commit comments