From 10ac8ccc3eae580d09ac063fd34bf9c92ea5fb4f Mon Sep 17 00:00:00 2001 From: glaucoheitor Date: Sat, 30 Apr 2022 12:24:34 -0700 Subject: [PATCH] [historical] changes requested --- src/modules/historical.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/historical.ts b/src/modules/historical.ts index f14d1c9f..3c04dd47 100644 --- a/src/modules/historical.ts +++ b/src/modules/historical.ts @@ -73,11 +73,13 @@ export default function historical( else if (typeof value === "string") { const timestamp = new Date(value as string).getTime(); - if (isNaN(timestamp) || timestamp <= 0) + if (isNaN(timestamp)) throw new Error( "yahooFinance.historical() option '" + fieldName + - "' invalid date provided." + "' invalid date provided: '" + + value + + "'" ); queryOptions[fieldName] = Math.floor(timestamp / 1000);