analytics/lib/plausible_web/views/billing_view.ex
Uku Taht 9476ccf95c
Yearly billing (#58)
* Add yearly billing options

* Add new subscription names

* Add note about yearly billing in the email

* Add a test for change_plan function

* Add allowance function back in

* Test billing controller endpoint
2020-04-21 14:11:38 +03:00

22 lines
396 B
Elixir

defmodule PlausibleWeb.BillingView do
use PlausibleWeb, :view
def present_date(date) do
Date.from_iso8601!(date)
|> Timex.format!("{D} {Mshort} {YYYY}")
end
def reccommended_plan(usage) do
cond do
usage < 9000 ->
"10k / mo"
usage < 90_000 ->
"100k / mo"
usage < 900_000 ->
"1m / mo"
true ->
"custom"
end
end
end