diff --git a/package.json b/package.json index 5d6ebcf..88f68af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@formio/cli", - "version": "2.3.0", + "version": "2.3.1-rc.1", "description": "The Form.io Command Line Interface application.", "main": "index.js", "scripts": { diff --git a/src/Cloner.js b/src/Cloner.js index 0eb80de..3e21ee1 100644 --- a/src/Cloner.js +++ b/src/Cloner.js @@ -234,10 +234,13 @@ 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)) { + // eslint-disable-next-line max-len + const srcModified = (srcItem.modified instanceof Date) ? srcItem.modified.getTime() : parseInt(srcItem.modified, 10); + if (this.options.modifiedAfter && srcModified < parseInt(this.options.modifiedAfter, 10)) { return false; } return true; @@ -1030,6 +1033,9 @@ class Cloner { return; } const decryptedDstSettings = dest ? this.decrypt(this.options.dstDbSecret, dest['settings_encrypted'], true) : {}; + if (!decryptedDstSettings) { + return; + } if (decryptedDstSettings.secret) { this.dstSecret = decryptedDstSettings.secret; }