diff --git a/lib/shared-method.js b/lib/shared-method.js index 5b469e64..6536d30c 100644 --- a/lib/shared-method.js +++ b/lib/shared-method.js @@ -398,8 +398,15 @@ function convertValueToTargetType(argName, value, targetType) { switch (targetType) { case 'string': return String(value).valueOf(); - case 'date': + case 'date': { + + // could be a timestamp as string + if (!isNaN(value) && typeof value == 'string') { + value = Number(value).valueOf(); + } + return new Date(value); + } case 'number': return Number(value).valueOf(); case 'boolean':