Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@drivekyte/date-utils

Package Overview
Dependencies
Maintainers
4
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@drivekyte/date-utils - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

11

dist/date-utils.es5.js

@@ -62,4 +62,15 @@ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};

// TODO: remove this workaround for the timezone issue: https://git.drivekyte.com/kytecoredevelopers/date-utils/-/issues/7
const utcFix = (option, dayjsClass) => {
// eslint-disable-next-line no-param-reassign
dayjsClass.prototype.valueOf = function () {
const addedOffset = !this.$utils().u(this.$offset)
? this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset())
: 0;
return this.$d.valueOf() - addedOffset * 60 * 1000;
};
};
dayjs.extend(dayjsUTC);
dayjs.extend(dayjsTimezone);
dayjs.extend(utcFix);
const getDateInServiceAreaTz = (date, timezone) => dayjs(date).tz(timezone, true).toDate().getTime();

@@ -66,0 +77,0 @@ const getDateInTz = (date, timezone) => {

@@ -66,4 +66,15 @@ 'use strict';

// TODO: remove this workaround for the timezone issue: https://git.drivekyte.com/kytecoredevelopers/date-utils/-/issues/7
const utcFix = (option, dayjsClass) => {
// eslint-disable-next-line no-param-reassign
dayjsClass.prototype.valueOf = function () {
const addedOffset = !this.$utils().u(this.$offset)
? this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset())
: 0;
return this.$d.valueOf() - addedOffset * 60 * 1000;
};
};
dayjs.extend(dayjsUTC);
dayjs.extend(dayjsTimezone);
dayjs.extend(utcFix);
const getDateInServiceAreaTz = (date, timezone) => dayjs(date).tz(timezone, true).toDate().getTime();

@@ -70,0 +81,0 @@ const getDateInTz = (date, timezone) => {

@@ -10,4 +10,15 @@ "use strict";

const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
// TODO: remove this workaround for the timezone issue: https://git.drivekyte.com/kytecoredevelopers/date-utils/-/issues/7
const utcFix = (option, dayjsClass) => {
// eslint-disable-next-line no-param-reassign
dayjsClass.prototype.valueOf = function () {
const addedOffset = !this.$utils().u(this.$offset)
? this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset())
: 0;
return this.$d.valueOf() - addedOffset * 60 * 1000;
};
};
dayjs_1.default.extend(utc_1.default);
dayjs_1.default.extend(timezone_1.default);
dayjs_1.default.extend(utcFix);
const getDateInServiceAreaTz = (date, timezone) => (0, dayjs_1.default)(date).tz(timezone, true).toDate().getTime();

@@ -14,0 +25,0 @@ const getDateInTz = (date, timezone) => {

2

package.json
{
"name": "@drivekyte/date-utils",
"version": "0.2.0",
"version": "0.2.1",
"description": "",

@@ -5,0 +5,0 @@ "keywords": [],

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc