mui-temporal-pickers 1.1.1 → 1.1.2

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.
@@ -52,7 +52,7 @@ const tokenToFieldMap = {
52
52
  a: "ampm",
53
53
  };
54
54
  const tokenRegexMap = {
55
- yy: "\\d{1,4}",
55
+ yy: "\\d{2}",
56
56
  yyyy: "\\d{4}",
57
57
  M: "\\d{1,2}",
58
58
  MM: "\\d{2}",
@@ -242,9 +242,9 @@ export class Formatter {
242
242
  if (value instanceof Temporal.PlainYearMonth || hasDate) {
243
243
  switch (token) {
244
244
  case "yy":
245
- return value.toString().slice(-2);
245
+ return value.year.toString().slice(-2).padStart(2, "0");
246
246
  case "yyyy":
247
- return value.year.toString();
247
+ return value.year.toString().padStart(4, "0");
248
248
  }
249
249
  }
250
250
  if (value instanceof Temporal.PlainYearMonth ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mui-temporal-pickers",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "A small utility library providing Temporal support for MUI X Date and Time Pickers",
5
5
  "author": "Ben Scholzen 'DASPRiD'",
6
6
  "keywords": [