Skip to content

Commit

Permalink
fix: ensure archive_date is captured always (#1942)
Browse files Browse the repository at this point in the history
most grants have a pre-determined archive date and having this be
behind a filter that enforces the date has to be <= today
eliminates any ability of us to capture these dates
  • Loading branch information
as1729 authored Sep 19, 2023
1 parent 6c5b4bc commit e87ac15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/server/src/lib/grants-ingest.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ function mapSourceDataToGrant(source) {
grant.open_date = milestones.post_date;
grant.close_date = milestones.close && milestones.close.date
? milestones.close.date : '2100-01-01';
grant.archive_date = milestones.archive_date;
const today = moment().startOf('day');
if (milestones.archive_date && today.isSameOrAfter(moment(milestones.archive_date), 'date')) {
grant.archive_date = milestones.archive_date;
grant.opportunity_status = 'archived';
} else if (today.isSameOrAfter(moment(grant.close_date), 'date')) {
grant.opportunity_status = 'closed';
Expand Down

0 comments on commit e87ac15

Please sign in to comment.