File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed
scripts/recruit-crm-job-import Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ async function processJob (job, info = []) {
133
133
data . resourceBookingId = result . id
134
134
}
135
135
// update the resourceBooking based on startDate and endDate
136
- const resourceBookingStatus = dateFNS . compareAsc ( new Date ( data . startDate ) , new Date ( data . endDate ) ) === 1 ? 'closed' : 'assigned'
136
+ const resourceBookingStatus = dateFNS . isBefore ( data . endDate , dateFNS . startOfToday ( ) ) ? 'closed' : 'assigned'
137
137
logger . debug ( `resourceBookingId: ${ data . resourceBookingId } status: ${ resourceBookingStatus } ` )
138
138
await helper . updateResourceBookingStatus ( data . resourceBookingId , resourceBookingStatus )
139
139
info . push ( { text : `id: ${ data . resourceBookingId } status: ${ resourceBookingStatus } resource booking updated` , tag : 'resource_booking_status_updated' } )
You can’t perform that action at this time.
0 commit comments