@wisemen/datewise 0.0.15 → 0.0.16
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/dist/date-time-range/date-time-range.dto.builder.d.ts +8 -0
- package/dist/date-time-range/date-time-range.dto.builder.js +21 -0
- package/dist/date-time-range/date-time-range.dto.builder.js.map +1 -0
- package/dist/date-time-range/date-time-range.dto.d.ts +7 -0
- package/dist/date-time-range/date-time-range.dto.js +34 -0
- package/dist/date-time-range/date-time-range.dto.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DateTimeRangeDto } from './date-time-range.dto.js';
|
|
2
|
+
export class DateTimeRangeDtoBuilder {
|
|
3
|
+
command;
|
|
4
|
+
constructor() {
|
|
5
|
+
this.command = new DateTimeRangeDto();
|
|
6
|
+
this.command.from = '-infinity';
|
|
7
|
+
this.command.until = 'infinity';
|
|
8
|
+
}
|
|
9
|
+
withFrom(date) {
|
|
10
|
+
this.command.from = date;
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
withUntil(date) {
|
|
14
|
+
this.command.until = date;
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
build() {
|
|
18
|
+
return this.command;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=date-time-range.dto.builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-time-range.dto.builder.js","sourceRoot":"","sources":["../../lib/date-time-range/date-time-range.dto.builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAE3D,MAAM,OAAO,uBAAuB;IACjB,OAAO,CAAkB;IAE1C;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,gBAAgB,EAAE,CAAA;QACrC,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,WAAW,CAAA;QAC/B,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,UAAU,CAAA;IACjC,CAAC;IAED,QAAQ,CAAE,IAAY;QACpB,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAA;QAExB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,SAAS,CAAE,IAAY;QACrB,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAA;QAEzB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK;QACH,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { FilterQuery } from '@wisemen/pagination';
|
|
11
|
+
import { IsTimestamp, TimestampApiProperty } from '../timestamp/index.js';
|
|
12
|
+
import { DateTimeRange } from './date-time-range.js';
|
|
13
|
+
export class DateTimeRangeDto extends FilterQuery {
|
|
14
|
+
from;
|
|
15
|
+
until;
|
|
16
|
+
parse() {
|
|
17
|
+
return new DateTimeRange(this.from, this.until);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
TimestampApiProperty({ description: 'start of the range, inclusive' }),
|
|
22
|
+
IsTimestamp({
|
|
23
|
+
isBefore: (dto) => dto.until
|
|
24
|
+
}),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], DateTimeRangeDto.prototype, "from", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
TimestampApiProperty({ description: 'end of the range, exclusive' }),
|
|
29
|
+
IsTimestamp({
|
|
30
|
+
isAfter: (dto) => dto.from
|
|
31
|
+
}),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], DateTimeRangeDto.prototype, "until", void 0);
|
|
34
|
+
//# sourceMappingURL=date-time-range.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-time-range.dto.js","sourceRoot":"","sources":["../../lib/date-time-range/date-time-range.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAK/C,IAAI,CAAQ;IAMZ,KAAK,CAAQ;IAEb,KAAK;QACH,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IACjD,CAAC;CACF;AAXC;IAJC,oBAAoB,CAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IACtE,WAAW,CAAC;QACX,QAAQ,EAAE,CAAC,GAAqB,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK;KAC/C,CAAC;;8CACU;AAMZ;IAJC,oBAAoB,CAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IACpE,WAAW,CAAC;QACX,OAAO,EAAE,CAAC,GAAqB,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI;KAC7C,CAAC;;+CACW"}
|