shoonya-sdk 0.4.7 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -510,10 +510,11 @@ var Shoonya = class extends import_events.EventEmitter {
510
510
  continue;
511
511
  const match = optionExpiry.match(/more-than-(\d+)-day/);
512
512
  if (match) {
513
- const dateNow = (/* @__PURE__ */ new Date()).getDate();
514
- const optionExpiryDate = unformattedDate.getDate();
513
+ const dateNow = (/* @__PURE__ */ new Date()).getTime();
514
+ const optionExpiryDate = unformattedDate.getTime();
515
+ const diff = (optionExpiryDate - dateNow) / (1e3 * 60 * 60 * 24);
515
516
  const check = parseInt(match[1], 10);
516
- if (Math.abs(optionExpiryDate - dateNow) < check)
517
+ if (diff < check)
517
518
  continue;
518
519
  }
519
520
  for (const { tsym, token } of optionChain.values) {
@@ -484,10 +484,11 @@ var Shoonya = class extends EventEmitter {
484
484
  continue;
485
485
  const match = optionExpiry.match(/more-than-(\d+)-day/);
486
486
  if (match) {
487
- const dateNow = (/* @__PURE__ */ new Date()).getDate();
488
- const optionExpiryDate = unformattedDate.getDate();
487
+ const dateNow = (/* @__PURE__ */ new Date()).getTime();
488
+ const optionExpiryDate = unformattedDate.getTime();
489
+ const diff = (optionExpiryDate - dateNow) / (1e3 * 60 * 60 * 24);
489
490
  const check = parseInt(match[1], 10);
490
- if (Math.abs(optionExpiryDate - dateNow) < check)
491
+ if (diff < check)
491
492
  continue;
492
493
  }
493
494
  for (const { tsym, token } of optionChain.values) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shoonya-sdk",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "Wrapper around Shoonya API",
5
5
  "main": "dist/shoonya-sdk.js",
6
6
  "module": "dist/shoonya-sdk.mjs",