@naturalcycles/js-lib 14.243.0 → 14.244.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.
@@ -14,7 +14,7 @@ class TimeInterval {
14
14
  this.$end = $end;
15
15
  }
16
16
  static of(start, end) {
17
- return new TimeInterval(localTime_1.localTime.parseToUnixTimestamp(start), localTime_1.localTime.parseToUnixTimestamp(end));
17
+ return new TimeInterval(localTime_1.localTime.from(start).unix, localTime_1.localTime.from(end).unix);
18
18
  }
19
19
  get start() {
20
20
  return this.$start;
@@ -58,7 +58,7 @@ class TimeInterval {
58
58
  return this.cmp(d) >= 0;
59
59
  }
60
60
  includes(d, incl = '[)') {
61
- d = localTime_1.localTime.parseToUnixTimestamp(d);
61
+ d = localTime_1.localTime.from(d).unix;
62
62
  // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
63
63
  if (d < this.$start || (d === this.$start && incl[0] === '('))
64
64
  return false;
@@ -4,11 +4,11 @@ exports.generateBuildInfoDev = generateBuildInfoDev;
4
4
  const localTime_1 = require("../datetime/localTime");
5
5
  function generateBuildInfoDev() {
6
6
  const now = localTime_1.localTime.now();
7
- const ts = now.unix();
7
+ const ts = now.unix;
8
8
  const rev = 'devRev';
9
9
  const branchName = 'devBranch';
10
10
  const repoName = 'devRepo';
11
- const tsCommit = now.unix();
11
+ const tsCommit = now.unix;
12
12
  const ver = [now.toStringCompact(), repoName, branchName, rev].join('_');
13
13
  return {
14
14
  ts,
@@ -60,7 +60,7 @@ export class DateInterval {
60
60
  */
61
61
  cmp(d) {
62
62
  d = DateInterval.parse(d);
63
- return this.start.cmp(d.start) || this.end.cmp(d.end);
63
+ return this.start.compare(d.start) || this.end.compare(d.end);
64
64
  }
65
65
  getDays(incl = '[]') {
66
66
  return localDate.range(this.start, this.end, incl, 1, 'day');