@formatjs/ecma402-abstract 2.3.4 → 2.3.6

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.
package/262.js CHANGED
@@ -201,6 +201,13 @@ function WeekDay(t) {
201
201
  * @param y
202
202
  */
203
203
  function DayFromYear(y) {
204
+ if (y < 100) {
205
+ // Date.UTC parses 0 - 99 as 1900 - 1999
206
+ var date = new Date(0);
207
+ date.setUTCFullYear(y, 0, 1);
208
+ date.setUTCHours(0, 0, 0, 0);
209
+ return date.getTime() / MS_PER_DAY;
210
+ }
204
211
  return Date.UTC(y, 0) / MS_PER_DAY;
205
212
  }
206
213
  /**
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * Partition a pattern into a list of literals and placeholders
2
3
  * https://tc39.es/ecma402/#sec-partitionpattern
3
4
  * @param pattern
4
5
  */
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PartitionPattern = PartitionPattern;
4
4
  var utils_1 = require("./utils");
5
5
  /**
6
+ * Partition a pattern into a list of literals and placeholders
6
7
  * https://tc39.es/ecma402/#sec-partitionpattern
7
8
  * @param pattern
8
9
  */
package/lib/262.js CHANGED
@@ -175,6 +175,13 @@ export function WeekDay(t) {
175
175
  * @param y
176
176
  */
177
177
  export function DayFromYear(y) {
178
+ if (y < 100) {
179
+ // Date.UTC parses 0 - 99 as 1900 - 1999
180
+ var date = new Date(0);
181
+ date.setUTCFullYear(y, 0, 1);
182
+ date.setUTCHours(0, 0, 0, 0);
183
+ return date.getTime() / MS_PER_DAY;
184
+ }
178
185
  return Date.UTC(y, 0) / MS_PER_DAY;
179
186
  }
180
187
  /**
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * Partition a pattern into a list of literals and placeholders
2
3
  * https://tc39.es/ecma402/#sec-partitionpattern
3
4
  * @param pattern
4
5
  */
@@ -1,5 +1,6 @@
1
1
  import { invariant } from './utils';
2
2
  /**
3
+ * Partition a pattern into a list of literals and placeholders
3
4
  * https://tc39.es/ecma402/#sec-partitionpattern
4
5
  * @param pattern
5
6
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formatjs/ecma402-abstract",
3
3
  "description": "A collection of implementation for ECMAScript abstract operations",
4
- "version": "2.3.4",
4
+ "version": "2.3.6",
5
5
  "license": "MIT",
6
6
  "author": "Long Ho <holevietlong@gmail.com",
7
7
  "sideEffects": false,
@@ -9,8 +9,8 @@
9
9
  "dependencies": {
10
10
  "decimal.js": "^10.4.3",
11
11
  "tslib": "^2.8.0",
12
- "@formatjs/fast-memoize": "2.2.7",
13
- "@formatjs/intl-localematcher": "0.6.1"
12
+ "@formatjs/intl-localematcher": "0.6.2",
13
+ "@formatjs/fast-memoize": "2.2.7"
14
14
  },
15
15
  "bugs": "https://github.com/formatjs/formatjs/issues",
16
16
  "gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c",