mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
* Fix: make date format year consistent overall * chore: Consolidating all date formatting options * adding disabled condition back to mint import * chore: Moving formats from helper to models/family.rd * Adding date_format_label to the en translation for import/configurations * nit: making changes to use individual translations
This commit is contained in:
parent
b02380ac97
commit
f57fa526af
8 changed files with 23 additions and 21 deletions
|
@ -1,7 +1,17 @@
|
|||
class Family < ApplicationRecord
|
||||
include Plaidable, Syncable
|
||||
|
||||
DATE_FORMATS = [ "%m-%d-%Y", "%d.%m.%Y", "%d-%m-%Y", "%Y-%m-%d", "%d/%m/%Y", "%Y/%m/%d", "%m/%d/%Y", "%e/%m/%Y", "%Y.%m.%d" ]
|
||||
DATE_FORMATS = [
|
||||
[ "MM-DD-YYYY", "%m-%d-%Y" ],
|
||||
[ "DD.MM.YYYY", "%d.%m.%Y" ],
|
||||
[ "DD-MM-YYYY", "%d-%m-%Y" ],
|
||||
[ "YYYY-MM-DD", "%Y-%m-%d" ],
|
||||
[ "DD/MM/YYYY", "%d/%m/%Y" ],
|
||||
[ "YYYY/MM/DD", "%Y/%m/%d" ],
|
||||
[ "MM/DD/YYYY", "%m/%d/%Y" ],
|
||||
[ "D/MM/YYYY", "%e/%m/%Y" ],
|
||||
[ "YYYY.MM.DD", "%Y.%m.%d" ]
|
||||
].freeze
|
||||
|
||||
include Providable
|
||||
|
||||
|
@ -21,7 +31,7 @@ class Family < ApplicationRecord
|
|||
has_many :budget_categories, through: :budgets
|
||||
|
||||
validates :locale, inclusion: { in: I18n.available_locales.map(&:to_s) }
|
||||
validates :date_format, inclusion: { in: DATE_FORMATS }
|
||||
validates :date_format, inclusion: { in: DATE_FORMATS.map(&:last) }
|
||||
|
||||
def sync_data(start_date: nil)
|
||||
update!(last_synced_at: Time.current)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue