stockshark-util
Advanced tools
Comparing version 1.0.10 to 1.0.11
{ | ||
"name": "stockshark-util", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "util", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
const util = require('./util'); | ||
const holidays = require('./holidays.json'); | ||
function willMarketOpen() { | ||
if (!this.isTodayTradingDay()) return false | ||
const dtNow = util.nowET() | ||
const dtOpen = this.getTodayMarketOpenDateTime() | ||
return (dtNow < dtOpen) | ||
} | ||
function isMarketOpen() { | ||
@@ -12,2 +19,9 @@ if (!this.isTodayTradingDay()) return false | ||
function wasMarketOpen() { | ||
if (!this.isTodayTradingDay()) return false | ||
const dtNow = util.nowET() | ||
const dtClose = this.getTodayMarketCloseDateTime() | ||
return (dtNow > dtClose) | ||
} | ||
function isTradingDay(dateStr) { | ||
@@ -104,3 +118,5 @@ return !holidays.includes(dateStr) && !util.isWeekend(dateStr) | ||
module.exports = { | ||
willMarketOpen, | ||
isMarketOpen, | ||
wasMarketOpen, | ||
isTradingDay, | ||
@@ -107,0 +123,0 @@ isTodayTradingDay, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30706
470