natdeanlewissoftwire
2 years ago
29 changed files with 249 additions and 109 deletions
@ -1,16 +1,26 @@
|
||||
module CollectionTimeHelper |
||||
def collection_start_year(date) |
||||
window_end_date = Time.zone.local(date.year, 4, 1) |
||||
date < window_end_date ? date.year - 1 : date.year |
||||
end |
||||
|
||||
def current_collection_start_year |
||||
today = Time.zone.now |
||||
window_end_date = Time.zone.local(today.year, 4, 1) |
||||
today < window_end_date ? today.year - 1 : today.year |
||||
collection_start_year(Time.zone.now) |
||||
end |
||||
|
||||
def collection_start_date(date) |
||||
window_end_date = Time.zone.local(date.year, 4, 1) |
||||
date < window_end_date ? Time.zone.local(date.year - 1, 4, 1) : Time.zone.local(date.year, 4, 1) |
||||
Time.zone.local(collection_start_year(date), 4, 1) |
||||
end |
||||
|
||||
def current_collection_start_date |
||||
Time.zone.local(current_collection_start_year, 4, 1) |
||||
end |
||||
|
||||
def collection_end_date(date) |
||||
Time.zone.local(collection_start_year(date) + 1, 3, 31) |
||||
end |
||||
|
||||
def current_collection_end_date |
||||
Time.zone.local(current_collection_start_year + 1, 3, 31) |
||||
end |
||||
end |
||||
|
@ -1 +1 @@
|
||||
PWC9A1AmalyFv4A63MG9jCm2YtwE1Eyu1BJKodtbmq2nW7FD9svZZ3V4yC0JO9J8sLfCS6UrxQC4TOKKYWP5iYpOr5TKPi9MqNCVueLsoErN+nMAPhCJVpl8+eJ4BOvNYGlmle4bcwbAvHLq6IoANTBjktFh5/tgJS+IHBWK1FwPzK1eAhgQ1fE1jluWslee4iYesmh+ufHIMZAkoWuGJVky4i4uN5nKnwQfaPN5MUxBlvGiDH+s+yex4pcIaJ6hxYWAQRZXJRQVpZcf/agwU0Tk/S/fuDMm8zVeHCQkkmsCYzH5czB8b8IWYwyslqFBZNCix7YnbgwgYk8MUh7wPBuF8CFoPKVyteqic9HgUp9KY8kkt/RcWJ4zpv+Vwz3cre+iZ3S1bxFcSxXqO0MGRug2H9iwhAnBQDLl3vXLNNRYEL5LhNv0Z9Cy7at1fnYe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