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

@shopify/dates

Package Overview
Dependencies
Maintainers
13
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/dates - npm Package Compare versions

Comparing version 0.4.1 to 1.0.0-sknext-beta.1

build/cjs/apply-time-zone-offset.js

30

package.json
{
"name": "@shopify/dates",
"version": "0.4.1",
"version": "1.0.0-sknext-beta.1",
"license": "MIT",
"description": "Lightweight date operations library",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"main": "index.js",
"types": "index.d.ts",
"scripts": {

@@ -27,12 +27,26 @@ "build": "tsc --p tsconfig.json"

"dependencies": {
"@shopify/decorators": "^1.1.12",
"@shopify/decorators": "1.0.0-sknext-beta.1",
"tslib": "^1.9.3"
},
"devDependencies": {
"@shopify/jest-dom-mocks": "^2.9.1"
"@shopify/jest-dom-mocks": "1.0.0-sknext-beta.1"
},
"files": [
"dist/*",
"!tsconfig.tsbuildinfo"
]
"build/*",
"!tsconfig.tsbuildinfo",
"index.js",
"index.mjs",
"index.esnext",
"index.d.ts"
],
"module": "index.mjs",
"esnext": "index.esnext",
"exports": {
"./": "./",
".": {
"import": "./index.mjs",
"require": "./index.js",
"esnext": "./index.esnext"
}
}
}

@@ -21,3 +21,3 @@ # `@shopify/dates`

Takes in a date object and two optional time zone string parameters. Returns a new date object with the offset between the time zones added to it.
Takes in a date object and two optional time zone string parameters. Returns a new date object with the offset between the time zones added to it. We can also assume the passed date is in the first time zone and we want to calculate it in the second time zone.

@@ -31,3 +31,3 @@ ```ts

const newDate = applyTimeZoneOffset(date, timeZone1, timeZone2);
const newDate = applyTimeZoneOffset(date, timeZone1, timeZone2); //'2018-06-01T02:00:00.000Z'
```

@@ -329,3 +329,3 @@

Takes in a date object and two optional time zone string parameters. Returns a new date object with the offset between the time zones subtracted from it.
Takes in a date object and two optional time zone string parameters. Returns a new date object with the offset between the time zones subtracted from it. We can also assume the passed date is in the second time zone and we want to calculate it back in the first time zone.

@@ -336,5 +336,6 @@ ```ts

const date = new Date('2018-06-01Z14:00');
const timeZone = 'Australia/Perth';
const timeZone1 = 'Australia/Perth';
const timeZone2 = 'America/Toronto';
const newDate = unapplyTimeZoneOffset(date, offset);
const newDate = unapplyTimeZoneOffset(date, timeZone1, timeZone2); //2018-06-02T02:00:00.000Z
```
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