Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into mention-react-form
Browse files Browse the repository at this point in the history
  • Loading branch information
alanthai authored Feb 20, 2020
2 parents b810026 + b410ce0 commit 95c4a11
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 10 deletions.
4 changes: 4 additions & 0 deletions packages/dates/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
17 changes: 17 additions & 0 deletions packages/dates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion packages/dates/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/dates/src/get-date-time-parts.ts
Original file line number Diff line number Diff line change
@@ -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})/;
Expand Down
1 change: 1 addition & 0 deletions packages/dates/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
1 change: 1 addition & 0 deletions packages/dates/src/utilities/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {formatDate} from './formatDate';
6 changes: 5 additions & 1 deletion packages/dates/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
]
}
6 changes: 5 additions & 1 deletion packages/koa-shopify-graphql-proxy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- ## [Unreleased] -->

## 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

Expand Down
2 changes: 1 addition & 1 deletion packages/koa-shopify-graphql-proxy/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
Expand Down
4 changes: 4 additions & 0 deletions packages/koa-shopify-webhooks/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- ## Unreleased -->

## [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
Expand Down
2 changes: 1 addition & 1 deletion packages/koa-shopify-webhooks/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 2 additions & 0 deletions packages/koa-shopify-webhooks/src/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
Expand Down
4 changes: 2 additions & 2 deletions packages/react-i18n-universal-provider/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions packages/react-i18n/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 95c4a11

Please sign in to comment.