diff --git a/packages/dates/CHANGELOG.md b/packages/dates/CHANGELOG.md index b4835d934b..bf21db4b42 100644 --- a/packages/dates/CHANGELOG.md +++ b/packages/dates/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). --- +## [0.3.0] - 2020-02-19 + +- Export the `formatDate` function so it can be used by other packages / projects, e.g. in `@shopify/react-i18n` + ## [0.2.13] - 2020-02-07 - Fixes the memory leak that was introduced in v0.1.27 when server-side rendering ([#1277](https://github.com/Shopify/quilt/pull/1277)) diff --git a/packages/dates/README.md b/packages/dates/README.md index 44793f6d54..b311f6e682 100644 --- a/packages/dates/README.md +++ b/packages/dates/README.md @@ -30,6 +30,23 @@ const timeZone2 = 'America/Toronto'; const newDate = applyTimeZoneOffset(date, timeZone1, timeZone2); ``` +### `formatDate` + +Takes in a date object and two additional parameters, the locale and an optional options object. Returns a new date string with the applied locale and options. + +```ts +import {formatDate} from '@shopify/dates'; + +const date = new Date('2020-02-18Z14:00'); +const locales = 'en'; +const options = { + timeZone: 'America/New_York', + hour: 'numeric', +}; + +const newDate = formatDate(date, locales, options); // 9 AM +``` + ### `getDateTimeParts` Takes in a date object and an optional time zone string parameter. Returns an object with functions to get the year, month, day, weekday, hour, minute and second of the provided date. diff --git a/packages/dates/package.json b/packages/dates/package.json index 01ef5c3d13..c33bd13f46 100644 --- a/packages/dates/package.json +++ b/packages/dates/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/dates", - "version": "0.2.13", + "version": "0.3.0", "license": "MIT", "description": "Lightweight date operations library.", "main": "dist/src/index.js", diff --git a/packages/dates/src/get-date-time-parts.ts b/packages/dates/src/get-date-time-parts.ts index 7efdade053..c22e6b50fb 100644 --- a/packages/dates/src/get-date-time-parts.ts +++ b/packages/dates/src/get-date-time-parts.ts @@ -1,6 +1,6 @@ import {memoize} from '@shopify/decorators'; -import {formatDate} from './utilities/formatDate'; +import {formatDate} from './utilities'; import {sanitiseDateString} from './sanitise-date-string'; const TWO_DIGIT_REGEX = /(\d{2})/; diff --git a/packages/dates/src/index.ts b/packages/dates/src/index.ts index e76bb3b1d5..52bf873d5e 100644 --- a/packages/dates/src/index.ts +++ b/packages/dates/src/index.ts @@ -19,3 +19,4 @@ export * from './parse-date-string-parts'; export * from './sanitise-date-string'; export * from './unapply-time-zone-offset'; export * from './map-deprecated-timezones'; +export * from './utilities'; diff --git a/packages/dates/src/utilities/index.ts b/packages/dates/src/utilities/index.ts new file mode 100644 index 0000000000..6442a6c317 --- /dev/null +++ b/packages/dates/src/utilities/index.ts @@ -0,0 +1 @@ +export {formatDate} from './formatDate'; diff --git a/packages/dates/tsconfig.json b/packages/dates/tsconfig.json index 84c504e0e6..f010ef67e3 100644 --- a/packages/dates/tsconfig.json +++ b/packages/dates/tsconfig.json @@ -11,5 +11,9 @@ "./src/**/*.tsx" ], "exclude": ["**/*.test.ts", "**/*.test.tsx"], - "references": [{"path": "../address"}, {"path": "../function-enhancers"}, {"path": "../decorators"}] + "references": [ + {"path": "../address"}, + {"path": "../function-enhancers"}, + {"path": "../decorators"} + ] } diff --git a/packages/koa-shopify-graphql-proxy/CHANGELOG.md b/packages/koa-shopify-graphql-proxy/CHANGELOG.md index 6dc42b4949..5c6da0e1c5 100644 --- a/packages/koa-shopify-graphql-proxy/CHANGELOG.md +++ b/packages/koa-shopify-graphql-proxy/CHANGELOG.md @@ -7,7 +7,11 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## 3.2.0 - 2010-10-02 +## 3.3.0 - 2020-02-19 + += The `ApiVersion` enum now has an `January20` and `April20` options + +## 3.2.0 - 2019-10-02 = The `ApiVersion` enum now has an `October19` option diff --git a/packages/koa-shopify-graphql-proxy/package.json b/packages/koa-shopify-graphql-proxy/package.json index 3fe60f3736..03475579bf 100644 --- a/packages/koa-shopify-graphql-proxy/package.json +++ b/packages/koa-shopify-graphql-proxy/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/koa-shopify-graphql-proxy", - "version": "3.2.5", + "version": "3.3.0", "license": "MIT", "description": "A wrapper around koa-better-http-proxy which allows easy proxying of graphql requests from an embedded shopify app.", "main": "dist/src/index.js", diff --git a/packages/koa-shopify-graphql-proxy/src/shopify-graphql-proxy.ts b/packages/koa-shopify-graphql-proxy/src/shopify-graphql-proxy.ts index d75af1ac31..a82acc2782 100644 --- a/packages/koa-shopify-graphql-proxy/src/shopify-graphql-proxy.ts +++ b/packages/koa-shopify-graphql-proxy/src/shopify-graphql-proxy.ts @@ -8,6 +8,8 @@ export enum ApiVersion { April19 = '2019-04', July19 = '2019-07', October19 = '2019-10', + January20 = '2020-01', + April20 = '2020-04', Unstable = 'unstable', Unversioned = 'unversioned', } diff --git a/packages/koa-shopify-webhooks/CHANGELOG.md b/packages/koa-shopify-webhooks/CHANGELOG.md index a7e5bb34ce..4edc29afcb 100644 --- a/packages/koa-shopify-webhooks/CHANGELOG.md +++ b/packages/koa-shopify-webhooks/CHANGELOG.md @@ -7,6 +7,10 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [2.4.0] - 2020-02-19 + +- The `ApiVersion` enum now has an `January20` and `April20` options + ## [2.3.0] - 2020-01-27 - Add [webhooks for billing](https://help.shopify.com/en/api/guides/billing-api#webhooks-for-billing) to topics diff --git a/packages/koa-shopify-webhooks/package.json b/packages/koa-shopify-webhooks/package.json index 97c1778c2f..794c683578 100644 --- a/packages/koa-shopify-webhooks/package.json +++ b/packages/koa-shopify-webhooks/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/koa-shopify-webhooks", - "version": "2.3.1", + "version": "2.4.0", "license": "MIT", "description": "Receive webhooks from Shopify with ease.", "main": "dist/src/index.js", diff --git a/packages/koa-shopify-webhooks/src/register.ts b/packages/koa-shopify-webhooks/src/register.ts index 6513113153..14bf0f538c 100644 --- a/packages/koa-shopify-webhooks/src/register.ts +++ b/packages/koa-shopify-webhooks/src/register.ts @@ -6,6 +6,8 @@ export enum ApiVersion { April19 = '2019-04', July19 = '2019-07', October19 = '2019-10', + January20 = '2020-01', + April20 = '2020-04', Unstable = 'unstable', Unversioned = 'unversioned', } diff --git a/packages/react-i18n-universal-provider/package.json b/packages/react-i18n-universal-provider/package.json index 1b163772bd..1e1a874793 100644 --- a/packages/react-i18n-universal-provider/package.json +++ b/packages/react-i18n-universal-provider/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/react-i18n-universal-provider", - "version": "1.0.36", + "version": "1.0.37", "license": "MIT", "description": "A self-serializing/deserializing i18n provider that works for isomorphic applications.", "main": "dist/src/index.js", @@ -26,7 +26,7 @@ "dependencies": { "@shopify/react-hooks": "^1.4.2", "@shopify/react-html": "^9.2.14", - "@shopify/react-i18n": "^2.3.8" + "@shopify/react-i18n": "^2.3.9" }, "peerDependencies": { "react": ">=16.8.0 <17.0.0" diff --git a/packages/react-i18n/package.json b/packages/react-i18n/package.json index d1aed7fc45..fd0a744123 100644 --- a/packages/react-i18n/package.json +++ b/packages/react-i18n/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/react-i18n", - "version": "2.3.8", + "version": "2.3.9", "license": "MIT", "description": "i18n utilities for React handling translations, formatting, and more.", "main": "dist/src/index.js", @@ -33,7 +33,7 @@ "intl-pluralrules": "^0.2.1" }, "dependencies": { - "@shopify/dates": "^0.2.13", + "@shopify/dates": "^0.3.0", "@shopify/decorators": "^1.1.9", "@shopify/function-enhancers": "^1.0.9", "@shopify/i18n": "^0.1.10",