Money.Subscription.days_remaining

You're seeing just the function days_remaining, go back to Money.Subscription module for more information.
Link to this function

days_remaining(plan, current_interval_started, effective_date, options \\ [])

View Source

Specs

days_remaining(Money.Subscription.Plan.t(), Date.t(), Date.t(), Keyword.t()) ::
  integer()

Returns number of days remaining in a plan interval.

Arguments

  • plan is any Money.Subscription.Plan.t

  • current_interval_started is a Date.t

  • effective_date is a Date.t after the current_interval_started and before the end of the plan_days

Returns

The number of days remaining in a plan interval

Examples

iex> plan = Money.Subscription.Plan.new! Money.new!(:USD, 100), :month, 1
iex> Money.Subscription.days_remaining plan, ~D[2018-01-01], ~D[2018-01-02]
30
iex> Money.Subscription.days_remaining plan, ~D[2018-02-01], ~D[2018-02-02]
27