Skip to content

Commit

Permalink
Merge pull request #275 from cfpb/fix-filing-date
Browse files Browse the repository at this point in the history
Adjust filing deadline
  • Loading branch information
PatrickGoRaft authored Mar 2, 2020
2 parents b20860d + 75e6b38 commit 35b1b17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/filing/constants/dates.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// YYYY will come from state as filingPeriod
export const FILING_START = { month: 0, day: 1 }
export const ONE_WEEK_TO_FILE = { month: 1, day: 21 } // one week out, possibly change messaging
export const FILING_DEADLINE = { month: 2, day: 1 }
export const FILING_DEADLINE = { month: 2, day: 2 }
export const FILING_PERIODS = [
'2019',
'2018'
Expand Down
5 changes: 3 additions & 2 deletions src/filing/utils/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@ export function withinAWeekOfDeadline(year) {
}

export function afterFilingPeriod(year) {
const timezoneOffsetHours = new Date().getTimezoneOffset() / 60 // Calculate UTC Hours Offset
const yearPlusOne = parseInt(year, 10) + 1
const deadline = Date.UTC(
yearPlusOne,
dates.FILING_DEADLINE.month,
dates.FILING_DEADLINE.day,
28,
23 + timezoneOffsetHours, // 1 second before Midnight, local time
59,
59 //28 is 23 in UTC-0500
59
)
if (!deadline) throw new Error('Error calculating filing period deadline')
return Date.now() > deadline
Expand Down

0 comments on commit 35b1b17

Please sign in to comment.