Skip to content

Commit 024bcc6

Browse files
committed
[email protected]'s change on OpenFn.org
1 parent 4713b6b commit 024bcc6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

form-sharing/4-upsertAsanaTask.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ fn(state => {
1818
};
1919
}) : [];
2020

21-
state.archivedFormsTasks = state.archivedForms.map(form => {
21+
const yesterday = new Date();
22+
yesterday.setDate(yesterday.getDate() - 1);
23+
yesterday.setHours(0, 0, 0, 0); // Set to beginning of yesterday
24+
25+
state.archivedFormsTasks = state.archivedForms
26+
.filter(form => new Date(form.date_modified) > yesterday)
27+
.map(form => {
2228
const dateModified = new Date(form.date_modified);
2329
const modifiedDatePlus5 = new Date(dateModified.getTime() + 5 * 24 * 60 * 60 * 1000)
2430
.toISOString()

0 commit comments

Comments
 (0)