mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 07:39:39 +02:00
Added more periods (#1714)
This commit is contained in:
parent
d2a7aef6ef
commit
2a202576f8
3 changed files with 36 additions and 6 deletions
|
@ -18,9 +18,20 @@ module FormsHelper
|
|||
end
|
||||
|
||||
def period_select(form:, selected:, classes: "border border-alpha-black-100 shadow-xs rounded-lg text-sm pr-7 cursor-pointer text-gray-900 focus:outline-none focus:ring-0")
|
||||
periods_for_select = [ [ "7D", "last_7_days" ], [ "1M", "last_30_days" ], [ "1Y", "last_365_days" ] ]
|
||||
periods_for_select = [
|
||||
%w[CWD current_week], # Current Week to Date
|
||||
%w[7D last_7_days],
|
||||
%w[MTD current_month], # Month to Date
|
||||
%w[1M last_30_days],
|
||||
%w[CQD current_quarter], # Quarter to Date
|
||||
%w[3M last_90_days],
|
||||
%w[YTD current_year], # Year to Date
|
||||
%w[1Y last_365_days]
|
||||
]
|
||||
|
||||
form.select(:period, periods_for_select, { selected: selected }, class: classes, data: { "auto-submit-form-target": "auto" })
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def currencies_for_select
|
||||
Money::Currency.all_instances.sort_by { |currency| [ currency.priority, currency.name ] }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue