Skip to content

Commit f2da57b

Browse files
Merge pull request #1981 from OneCommunityGlobal/sundar/fix-blueSquare-corn
Sundar: Fixed corn job failure for deleteBlueSquareAfterYear and assignment date of BlueSquare
2 parents 3a3c76a + e60d789 commit f2da57b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/helpers/userHelper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,8 @@ const userHelper = function () {
865865
}
866866

867867
const infringement = {
868-
date: moment().utc().format('YYYY-MM-DD'),
868+
// Use LA local date so the stored date matches the scheduler's intended business timezone
869+
date: moment().tz('America/Los_Angeles').startOf('day').format('YYYY-MM-DD'),
869870
description,
870871
createdDate: hasTimeOffRequest
871872
? moment(requestForTimeOff.createdAt).format('YYYY-MM-DD')
@@ -1149,8 +1150,7 @@ const userHelper = function () {
11491150

11501151
logger.logInfo(`Job for deleting blue squares older than 1 year starting at ${nowLA.format()}`);
11511152

1152-
const cutOffDate = nowLA.clone().subtract(1, 'year').toDate();
1153-
1153+
const cutOffDate = nowLA.clone().subtract(1, 'year').format('YYYY-MM-DD');
11541154
try {
11551155
const results = await userProfile.updateMany(
11561156
{},

0 commit comments

Comments
 (0)