date-vir 7.4.0 → 7.4.1

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.
@@ -42,6 +42,6 @@ export function toHtmlInputString(fullDate, inputType, includeSeconds) {
42
42
  return `${datePart}T${timePart}`;
43
43
  }
44
44
  else {
45
- throw new Error(`Unexpected inputTyped: '${String(inputType)}'. Expected usage of FullDatePart, one of ${getEnumValues(FullDatePart).join(', ')}.`);
45
+ throw new Error(`Unexpected inputTyped: '${inputType}'. Expected usage of FullDatePart, one of ${getEnumValues(FullDatePart).join(', ')}.`);
46
46
  }
47
47
  }
@@ -22,6 +22,18 @@ const knownStringFormats = [
22
22
  // padded hour
23
23
  // Sat, 01 Jun 2025 6:23:21 +0000 (UTC)
24
24
  'ccc, d LLL y HH:mm:ss ZZZ (z)',
25
+ // no padding
26
+ // Sat, 1 Jun 2025 6:23:21 +0000
27
+ 'ccc, d LLL y H:mm:ss ZZZ',
28
+ // all padding
29
+ // Sat, 01 Jun 2025 06:23:21 +0000
30
+ 'ccc, dd LLL y HH:mm:ss ZZZ',
31
+ // padded day
32
+ // Sat, 01 Jun 2025 6:23:21 +0000
33
+ 'ccc, dd LLL y H:mm:ss ZZZ',
34
+ // padded hour
35
+ // Sat, 01 Jun 2025 6:23:21 +0000
36
+ 'ccc, d LLL y HH:mm:ss ZZZ',
25
37
  ];
26
38
  /**
27
39
  * Tries extra known formats for parsing date strings, even those that browsers do not natively
@@ -36,7 +48,7 @@ export function parseDateString(dateString, timezone) {
36
48
  }
37
49
  let finalizedDateTime;
38
50
  knownStringFormats.some((format) => {
39
- const dateTimeAttempt = DateTime.fromFormat(dateString, format, { zone: timezone });
51
+ const dateTimeAttempt = DateTime.fromFormat(dateString.trim(), format, { zone: timezone });
40
52
  if (!dateTimeAttempt.isValid) {
41
53
  return false;
42
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "date-vir",
3
- "version": "7.4.0",
3
+ "version": "7.4.1",
4
4
  "description": "Easy and explicit dates and times.",
5
5
  "keywords": [
6
6
  "date",
@@ -34,26 +34,26 @@
34
34
  "test:docs": "virmator docs check"
35
35
  },
36
36
  "dependencies": {
37
- "@augment-vir/assert": "^31.28.0",
38
- "@augment-vir/common": "^31.28.0",
39
- "@date-vir/duration": "^7.4.0",
40
- "@types/luxon": "^3.6.2",
37
+ "@augment-vir/assert": "^31.33.0",
38
+ "@augment-vir/common": "^31.33.0",
39
+ "@date-vir/duration": "^7.4.1",
40
+ "@types/luxon": "^3.7.1",
41
41
  "luxon": "^3.7.1",
42
42
  "object-shape-tester": "^5.3.0",
43
43
  "type-fest": "^4.41.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@augment-vir/test": "^31.28.0",
46
+ "@augment-vir/test": "^31.33.0",
47
47
  "@web/dev-server-esbuild": "^1.0.4",
48
48
  "@web/test-runner": "^0.20.2",
49
49
  "@web/test-runner-commands": "^0.9.0",
50
50
  "@web/test-runner-playwright": "^0.11.1",
51
51
  "@web/test-runner-visual-regression": "^0.10.0",
52
- "element-vir": "^26.5.8",
52
+ "element-vir": "^26.9.0",
53
53
  "istanbul-smart-text-reporter": "^1.1.5",
54
54
  "markdown-code-example-inserter": "^3.0.3",
55
- "typedoc": "^0.28.7",
56
- "typescript": "^5.8.3"
55
+ "typedoc": "^0.28.11",
56
+ "typescript": "^5.9.2"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=22"