@naturalcycles/js-lib 14.245.1 → 14.246.0

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.
@@ -26,7 +26,6 @@ const VALID_DAYS_OF_WEEK = new Set([1, 2, 3, 4, 5, 6, 7]);
26
26
  * It supports 2 forms:
27
27
  * 1. 2023-03-03
28
28
  * 2. 2023-03-03T05:10:02
29
- * // todo: make it even looser, like Day.js
30
29
  */
31
30
  const DATE_TIME_REGEX_LOOSE = /^(\d{4})-(\d{2})-(\d{2})([Tt\s](\d{2}):?(\d{2})?:?(\d{2})?)?/;
32
31
  /**
@@ -36,7 +35,7 @@ const DATE_TIME_REGEX_LOOSE = /^(\d{4})-(\d{2})-(\d{2})([Tt\s](\d{2}):?(\d{2})?:
36
35
  * Ok, now it allows arbitrary stuff after `:ss`, to allow millis/timezone info,
37
36
  * but it will not take it into account.
38
37
  */
39
- const DATE_TIME_REGEX_STRICT = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/;
38
+ const DATE_TIME_REGEX_STRICT = /^(\d{4})-(\d{2})-(\d{2})[Tt\s](\d{2}):(\d{2}):(\d{2})/;
40
39
  const DATE_REGEX_STRICT = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
41
40
  class LocalTime {
42
41
  constructor($date) {
@@ -23,7 +23,6 @@ const VALID_DAYS_OF_WEEK = new Set([1, 2, 3, 4, 5, 6, 7]);
23
23
  * It supports 2 forms:
24
24
  * 1. 2023-03-03
25
25
  * 2. 2023-03-03T05:10:02
26
- * // todo: make it even looser, like Day.js
27
26
  */
28
27
  const DATE_TIME_REGEX_LOOSE = /^(\d{4})-(\d{2})-(\d{2})([Tt\s](\d{2}):?(\d{2})?:?(\d{2})?)?/;
29
28
  /**
@@ -33,7 +32,7 @@ const DATE_TIME_REGEX_LOOSE = /^(\d{4})-(\d{2})-(\d{2})([Tt\s](\d{2}):?(\d{2})?:
33
32
  * Ok, now it allows arbitrary stuff after `:ss`, to allow millis/timezone info,
34
33
  * but it will not take it into account.
35
34
  */
36
- const DATE_TIME_REGEX_STRICT = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/;
35
+ const DATE_TIME_REGEX_STRICT = /^(\d{4})-(\d{2})-(\d{2})[Tt\s](\d{2}):(\d{2}):(\d{2})/;
37
36
  const DATE_REGEX_STRICT = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
38
37
  export class LocalTime {
39
38
  constructor($date) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/js-lib",
3
- "version": "14.245.1",
3
+ "version": "14.246.0",
4
4
  "scripts": {
5
5
  "prepare": "husky",
6
6
  "build-prod": "build-prod-esm-cjs",
@@ -57,7 +57,6 @@ const VALID_DAYS_OF_WEEK = new Set([1, 2, 3, 4, 5, 6, 7])
57
57
  * It supports 2 forms:
58
58
  * 1. 2023-03-03
59
59
  * 2. 2023-03-03T05:10:02
60
- * // todo: make it even looser, like Day.js
61
60
  */
62
61
  const DATE_TIME_REGEX_LOOSE = /^(\d{4})-(\d{2})-(\d{2})([Tt\s](\d{2}):?(\d{2})?:?(\d{2})?)?/
63
62
  /**
@@ -67,7 +66,7 @@ const DATE_TIME_REGEX_LOOSE = /^(\d{4})-(\d{2})-(\d{2})([Tt\s](\d{2}):?(\d{2})?:
67
66
  * Ok, now it allows arbitrary stuff after `:ss`, to allow millis/timezone info,
68
67
  * but it will not take it into account.
69
68
  */
70
- const DATE_TIME_REGEX_STRICT = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/
69
+ const DATE_TIME_REGEX_STRICT = /^(\d{4})-(\d{2})-(\d{2})[Tt\s](\d{2}):(\d{2}):(\d{2})/
71
70
  const DATE_REGEX_STRICT = /^(\d\d\d\d)-(\d\d)-(\d\d)$/
72
71
 
73
72
  export class LocalTime {