1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-02 20:15:22 +02:00

Handle market holidays during holding sync (#1292)

* Handle market holidays during holding sync

* Use informal holidays instead of custom override
This commit is contained in:
Zach Gollwitzer 2024-10-10 18:02:12 -04:00 committed by GitHub
parent 77fc5caecf
commit 3399b74849
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 6 deletions

View file

@ -32,7 +32,11 @@ class Gapfiller
attr_reader :date_range, :cache
def should_gapfill?(date, record)
date.on_weekend? && record.nil?
(date.on_weekend? || holiday?(date)) && record.nil?
end
def holiday?(date)
Holidays.on(date, :federalreserve, :us, :informal).any?
end
def create_gapfilled_record(prev_record, date)