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 SourceSpecs
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 anyMoney.Subscription.Plan.t
current_interval_started
is aDate.t
effective_date
is aDate.t
after thecurrent_interval_started
and before the end of theplan_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