Skip to content

Commit

Permalink
Fixing the compaison for dates.
Browse files Browse the repository at this point in the history
  • Loading branch information
travist committed Apr 24, 2024
1 parent 370662d commit 0a78a2a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Cloner.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,12 @@ class Cloner {
if (this.options.submissionsOnly && collection !== 'submissions') {
return false;
}
if (this.options.createdAfter && srcItem.created < parseInt(this.options.createdAfter, 10)) {
const srcCreated = (srcItem.created instanceof Date) ? srcItem.created.getTime() : parseInt(srcItem.created, 10);
if (this.options.createdAfter && srcCreated < parseInt(this.options.createdAfter, 10)) {
return false;
}
if (this.options.modifiedAfter && srcItem.modified < parseInt(this.options.modifiedAfter, 10)) {
const srcModified = (srcItem.created instanceof Date) ? srcItem.modified.getTime() : parseInt(srcItem.modified, 10);
if (this.options.modifiedAfter && srcModified < parseInt(this.options.modifiedAfter, 10)) {
return false;
}
return true;
Expand Down

0 comments on commit 0a78a2a

Please sign in to comment.