diff --git a/src/resources/PatternsContext.js b/src/resources/PatternsContext.js index a524fa3..c0370d9 100644 --- a/src/resources/PatternsContext.js +++ b/src/resources/PatternsContext.js @@ -86,7 +86,14 @@ class PatternsContext extends PagedContext { * @returns {PatternsContext} Returns itself */ withAsOf(asOf) { - this.params.as_of = asOf.toISOString(); + let asOfDate; + if (asOf instanceof Date) { + asOfDate = asOf.toISOString(); + } else { + asOfDate = asOf; + } + + this.params.as_of = asOfDate; return this; }