@atlantjs/arch 15.6.6 → 15.6.7
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/package.json +3 -2
- package/src/@tool-box/tests/builder.abstract.util.d.ts +1 -0
- package/src/@tool-box/tests/builder.abstract.util.d.ts.map +1 -0
- package/src/@tool-box/tests/builders/datetime/datetime.edge.builder.d.ts +1 -0
- package/src/@tool-box/tests/builders/datetime/datetime.edge.builder.d.ts.map +1 -0
- package/src/@tool-box/tests/builders/failures/dummies/failure.dummy.d.ts +1 -0
- package/src/@tool-box/tests/builders/failures/dummies/failure.dummy.d.ts.map +1 -0
- package/src/@tool-box/tests/builders/failures/failure.builder.d.ts +1 -0
- package/src/@tool-box/tests/builders/failures/failure.builder.d.ts.map +1 -0
- package/src/@tool-box/tests/builders/metadata/metadata-uv.builder.d.ts +1 -0
- package/src/@tool-box/tests/builders/metadata/metadata-uv.builder.d.ts.map +1 -0
- package/src/@tool-box/tests/builders/metadata/metadata.edge.builder.d.ts +1 -0
- package/src/@tool-box/tests/builders/metadata/metadata.edge.builder.d.ts.map +1 -0
- package/src/@tool-box/tests/builders/user/email.edge.builder.d.ts +1 -0
- package/src/@tool-box/tests/builders/user/email.edge.builder.d.ts.map +1 -0
- package/src/@tool-box/tests/builders/user/username.edge.builder.d.ts +1 -0
- package/src/@tool-box/tests/builders/user/username.edge.builder.d.ts.map +1 -0
- package/src/@tool-box/tests/faker/faker.d.ts +1 -0
- package/src/@tool-box/tests/faker/faker.d.ts.map +1 -0
- package/src/@tool-box/utils/convert-units/convert-units.d.ts +1 -0
- package/src/@tool-box/utils/convert-units/convert-units.d.ts.map +1 -0
- package/src/@tool-box/utils/datatypes/boolean-utils.d.ts +1 -0
- package/src/@tool-box/utils/datatypes/boolean-utils.d.ts.map +1 -0
- package/src/@tool-box/utils/datatypes/generic-types.d.ts +1 -0
- package/src/@tool-box/utils/datatypes/generic-types.d.ts.map +1 -0
- package/src/@tool-box/utils/datatypes/plainify.d.ts +1 -0
- package/src/@tool-box/utils/datatypes/plainify.d.ts.map +1 -0
- package/src/@tool-box/utils/datatypes/string-utils.d.ts +1 -0
- package/src/@tool-box/utils/datatypes/string-utils.d.ts.map +1 -0
- package/src/@tool-box/utils/datetime/mappers/month.mapper.d.ts +1 -0
- package/src/@tool-box/utils/datetime/mappers/month.mapper.d.ts.map +1 -0
- package/src/@tool-box/utils/datetime/mappers/points/month-abbreviation.enum.d.ts +1 -0
- package/src/@tool-box/utils/datetime/mappers/points/month-abbreviation.enum.d.ts.map +1 -0
- package/src/@tool-box/utils/datetime/mappers/points/month-number.enum.d.ts +1 -0
- package/src/@tool-box/utils/datetime/mappers/points/month-number.enum.d.ts.map +1 -0
- package/src/@tool-box/utils/ducts/common.d.ts +1 -0
- package/src/@tool-box/utils/ducts/common.d.ts.map +1 -0
- package/src/@tool-box/utils/ducts/optional-type.d.ts +1 -0
- package/src/@tool-box/utils/ducts/optional-type.d.ts.map +1 -0
- package/src/@tool-box/utils/ducts/return-type.d.ts +1 -0
- package/src/@tool-box/utils/ducts/return-type.d.ts.map +1 -0
- package/src/@tool-box/utils/http-provider/http-provider-failure-response.d.ts +1 -0
- package/src/@tool-box/utils/http-provider/http-provider-failure-response.d.ts.map +1 -0
- package/src/@tool-box/utils/http-provider/http-provider-success-response.d.ts +1 -0
- package/src/@tool-box/utils/http-provider/http-provider-success-response.d.ts.map +1 -0
- package/src/@tool-box/utils/http-provider/http-provider.d.ts +1 -0
- package/src/@tool-box/utils/http-provider/http-provider.d.ts.map +1 -0
- package/src/@tool-box/utils/logger/index.d.ts +1 -0
- package/src/@tool-box/utils/logger/index.d.ts.map +1 -0
- package/src/@tool-box/utils/map/map.abstract.d.ts +1 -0
- package/src/@tool-box/utils/map/map.abstract.d.ts.map +1 -0
- package/src/@tool-box/utils/random/random.d.ts +1 -0
- package/src/@tool-box/utils/random/random.d.ts.map +1 -0
- package/src/@tool-box/utils/type-guard/guardian-exception.d.ts +1 -0
- package/src/@tool-box/utils/type-guard/guardian-exception.d.ts.map +1 -0
- package/src/@tool-box/utils/type-guard/guardian.d.ts +1 -0
- package/src/@tool-box/utils/type-guard/guardian.d.ts.map +1 -0
- package/src/@tool-box/utils/type-guard/guardian.type.d.ts +1 -0
- package/src/@tool-box/utils/type-guard/guardian.type.d.ts.map +1 -0
- package/src/@tool-box/utils/validators/is-cron-expression.d.ts +1 -0
- package/src/@tool-box/utils/validators/is-cron-expression.d.ts.map +1 -0
- package/src/@tool-box/utils/validators/is-date-string.d.ts +1 -0
- package/src/@tool-box/utils/validators/is-date-string.d.ts.map +1 -0
- package/src/@tool-box/utils/validators/is-password-match.d.ts +1 -0
- package/src/@tool-box/utils/validators/is-password-match.d.ts.map +1 -0
- package/src/@tool-box/utils/validators/is-password-policy.validator.d.ts +1 -0
- package/src/@tool-box/utils/validators/is-password-policy.validator.d.ts.map +1 -0
- package/src/@tool-box/utils/validators/is-schedule.d.ts +1 -0
- package/src/@tool-box/utils/validators/is-schedule.d.ts.map +1 -0
- package/src/@tool-box/utils/validators/is-time-string.d.ts +1 -0
- package/src/@tool-box/utils/validators/is-time-string.d.ts.map +1 -0
- package/src/@tool-box/utils/validators/is-ulid.d.ts +1 -0
- package/src/@tool-box/utils/validators/is-ulid.d.ts.map +1 -0
- package/src/index.d.ts +1 -0
- package/src/index.d.ts.map +1 -0
- package/src/objects/@common/edges/email.edge.d.ts +1 -0
- package/src/objects/@common/edges/email.edge.d.ts.map +1 -0
- package/src/objects/@common/edges/email.edge.js +0 -1
- package/src/objects/@common/edges/ulid.sketch.edge.d.ts +1 -0
- package/src/objects/@common/edges/ulid.sketch.edge.d.ts.map +1 -0
- package/src/objects/@common/edges/url.edge.d.ts +1 -0
- package/src/objects/@common/edges/url.edge.d.ts.map +1 -0
- package/src/objects/@common/edges/username.edge.d.ts +1 -0
- package/src/objects/@common/edges/username.edge.d.ts.map +1 -0
- package/src/objects/@common/edges/uuid.sketch.edge.d.ts +1 -0
- package/src/objects/@common/edges/uuid.sketch.edge.d.ts.map +1 -0
- package/src/objects/@common/points/environment.point.d.ts +1 -0
- package/src/objects/@common/points/environment.point.d.ts.map +1 -0
- package/src/objects/@common/points/header-token-name.point.d.ts +1 -0
- package/src/objects/@common/points/header-token-name.point.d.ts.map +1 -0
- package/src/objects/@common/points/http-status-codes.point.d.ts +1 -0
- package/src/objects/@common/points/http-status-codes.point.d.ts.map +1 -0
- package/src/objects/amount/amount-value.edge.d.ts +1 -0
- package/src/objects/amount/amount-value.edge.d.ts.map +1 -0
- package/src/objects/amount/amount.edge.d.ts +142 -132
- package/src/objects/amount/amount.edge.d.ts.map +1 -0
- package/src/objects/amount/amount.edge.js +168 -141
- package/src/objects/amount/amount.polygon.d.ts +1 -0
- package/src/objects/amount/amount.polygon.d.ts.map +1 -0
- package/src/objects/amount/amount.uv.d.ts +2 -1
- package/src/objects/amount/amount.uv.d.ts.map +1 -0
- package/src/objects/amount/amount.uv.js +1 -1
- package/src/objects/amount/points/duration-unit.point.d.ts +1 -0
- package/src/objects/amount/points/duration-unit.point.d.ts.map +1 -0
- package/src/objects/amount/points/energy-unit.point.d.ts +1 -0
- package/src/objects/amount/points/energy-unit.point.d.ts.map +1 -0
- package/src/objects/amount/points/length-unit.point.d.ts +1 -0
- package/src/objects/amount/points/length-unit.point.d.ts.map +1 -0
- package/src/objects/amount/points/mass-unit.point.d.ts +1 -0
- package/src/objects/amount/points/mass-unit.point.d.ts.map +1 -0
- package/src/objects/amount/points/month-name.point.d.ts +1 -0
- package/src/objects/amount/points/month-name.point.d.ts.map +1 -0
- package/src/objects/amount/points/object-unit.point.d.ts +1 -0
- package/src/objects/amount/points/object-unit.point.d.ts.map +1 -0
- package/src/objects/amount/points/units.point.d.ts +1 -0
- package/src/objects/amount/points/units.point.d.ts.map +1 -0
- package/src/objects/amount/points/volume-unit.point.d.ts +1 -0
- package/src/objects/amount/points/volume-unit.point.d.ts.map +1 -0
- package/src/objects/amount/points/week-day.point.d.ts +1 -0
- package/src/objects/amount/points/week-day.point.d.ts.map +1 -0
- package/src/objects/datetime/edges/datetime.edge.d.ts +174 -162
- package/src/objects/datetime/edges/datetime.edge.d.ts.map +1 -0
- package/src/objects/datetime/edges/datetime.edge.js +207 -218
- package/src/objects/datetime/edges/locale/day/day-name-to-english.mapper.d.ts +5 -0
- package/src/objects/datetime/edges/locale/day/day-name-to-english.mapper.d.ts.map +1 -0
- package/src/objects/datetime/edges/locale/day/day-name-to-english.mapper.js +19 -0
- package/src/objects/datetime/edges/locale/day/day-name-to-portuguese.mapper.d.ts +5 -0
- package/src/objects/datetime/edges/locale/day/day-name-to-portuguese.mapper.d.ts.map +1 -0
- package/src/objects/datetime/edges/locale/day/day-name-to-portuguese.mapper.js +19 -0
- package/src/objects/datetime/edges/locale/day/today-to-language.mapper.d.ts +6 -0
- package/src/objects/datetime/edges/locale/day/today-to-language.mapper.d.ts.map +1 -0
- package/src/objects/datetime/edges/locale/day/today-to-language.mapper.js +15 -0
- package/src/objects/datetime/edges/locale/holidays-country.type.d.ts +3 -0
- package/src/objects/datetime/edges/locale/holidays-country.type.d.ts.map +1 -0
- package/src/objects/datetime/edges/locale/holidays-country.type.js +2 -0
- package/src/objects/datetime/edges/locale/month/month-to-english.mapper.d.ts +5 -0
- package/src/objects/datetime/edges/locale/month/month-to-english.mapper.d.ts.map +1 -0
- package/src/objects/datetime/edges/locale/month/month-to-english.mapper.js +24 -0
- package/src/objects/datetime/edges/locale/month/month-to-portuguese.mapper.d.ts +5 -0
- package/src/objects/datetime/edges/locale/month/month-to-portuguese.mapper.d.ts.map +1 -0
- package/src/objects/datetime/edges/locale/month/month-to-portuguese.mapper.js +24 -0
- package/src/objects/datetime/points/month-name.enum.d.ts +1 -0
- package/src/objects/datetime/points/month-name.enum.d.ts.map +1 -0
- package/src/objects/datetime/points/week-day.enum.d.ts +1 -0
- package/src/objects/datetime/points/week-day.enum.d.ts.map +1 -0
- package/src/objects/failure/edges/failure.abstract.d.ts +1 -0
- package/src/objects/failure/edges/failure.abstract.d.ts.map +1 -0
- package/src/objects/failure/edges/failure.abstract.polygon.d.ts +1 -0
- package/src/objects/failure/edges/failure.abstract.polygon.d.ts.map +1 -0
- package/src/objects/language/points/language.point.d.ts +1 -0
- package/src/objects/language/points/language.point.d.ts.map +1 -0
- package/src/objects/metadata/metadata.edge.d.ts +1 -0
- package/src/objects/metadata/metadata.edge.d.ts.map +1 -0
- package/src/objects/metadata/metadata.polygon.d.ts +1 -0
- package/src/objects/metadata/metadata.polygon.d.ts.map +1 -0
- package/src/objects/metadata/metadata.uv.d.ts +1 -0
- package/src/objects/metadata/metadata.uv.d.ts.map +1 -0
- package/src/objects/password/password.edge.d.ts +1 -0
- package/src/objects/password/password.edge.d.ts.map +1 -0
- package/src/objects/password/password.polygon.d.ts +1 -0
- package/src/objects/password/password.polygon.d.ts.map +1 -0
- package/src/objects/password/steps/not-allowing-consecutive-chars-step.d.ts +1 -0
- package/src/objects/password/steps/not-allowing-consecutive-chars-step.d.ts.map +1 -0
- package/src/objects/password/steps/not-allowing-date-step.d.ts +1 -0
- package/src/objects/password/steps/not-allowing-date-step.d.ts.map +1 -0
- package/src/objects/password/steps/not-allowing-phone-step.d.ts +1 -0
- package/src/objects/password/steps/not-allowing-phone-step.d.ts.map +1 -0
- package/src/objects/password/steps/not-allowing-repeated-chars-step.d.ts +1 -0
- package/src/objects/password/steps/not-allowing-repeated-chars-step.d.ts.map +1 -0
- package/src/objects/password/steps/not-allowing-string-step.d.ts +1 -0
- package/src/objects/password/steps/not-allowing-string-step.d.ts.map +1 -0
- package/src/objects/password/steps/not-allowing-these-chars-step.d.ts +1 -0
- package/src/objects/password/steps/not-allowing-these-chars-step.d.ts.map +1 -0
- package/src/objects/password/steps/numeric-step.d.ts +1 -0
- package/src/objects/password/steps/numeric-step.d.ts.map +1 -0
- package/src/objects/password/steps/with-at-least-one-letter-step.d.ts +1 -0
- package/src/objects/password/steps/with-at-least-one-letter-step.d.ts.map +1 -0
- package/src/objects/password/steps/with-at-least-one-number-digit-step.d.ts +1 -0
- package/src/objects/password/steps/with-at-least-one-number-digit-step.d.ts.map +1 -0
- package/src/objects/password/steps/with-at-least-one-special-char-step.d.ts +1 -0
- package/src/objects/password/steps/with-at-least-one-special-char-step.d.ts.map +1 -0
- package/src/objects/password/steps/with-length-step.d.ts +1 -0
- package/src/objects/password/steps/with-length-step.d.ts.map +1 -0
- package/src/objects/password/validation-step.d.ts +1 -0
- package/src/objects/password/validation-step.d.ts.map +1 -0
- package/src/objects/password/validation-step.type.d.ts +1 -0
- package/src/objects/password/validation-step.type.d.ts.map +1 -0
- package/src/objects/primitives/boolean.edge.sketch.d.ts +1 -0
- package/src/objects/primitives/boolean.edge.sketch.d.ts.map +1 -0
- package/src/objects/primitives/datetime.edge.sketch.d.ts +1 -0
- package/src/objects/primitives/datetime.edge.sketch.d.ts.map +1 -0
- package/src/objects/primitives/number.edge.sketch.d.ts +1 -0
- package/src/objects/primitives/number.edge.sketch.d.ts.map +1 -0
- package/src/objects/primitives/string.edge.sketch.d.ts +1 -0
- package/src/objects/primitives/string.edge.sketch.d.ts.map +1 -0
- package/src/objects/scheduling/scheduling.edge.d.ts +1 -0
- package/src/objects/scheduling/scheduling.edge.d.ts.map +1 -0
- package/src/objects/scheduling/scheduling.edge.failure.d.ts +1 -0
- package/src/objects/scheduling/scheduling.edge.failure.d.ts.map +1 -0
- package/src/objects/time/time.edge.d.ts +1 -0
- package/src/objects/time/time.edge.d.ts.map +1 -0
- package/src/objects-interface/edges/edge.abstract.d.ts +1 -0
- package/src/objects-interface/edges/edge.abstract.d.ts.map +1 -0
- package/src/objects-interface/face.abstract.d.ts +1 -0
- package/src/objects-interface/face.abstract.d.ts.map +1 -0
- package/src/objects-interface/solid.abstract.d.ts +1 -0
- package/src/objects-interface/solid.abstract.d.ts.map +1 -0
- package/src/objects-interface/uv.abstract.d.ts +1 -0
- package/src/objects-interface/uv.abstract.d.ts.map +1 -0
- package/src/objects-interface/vertices/vertex.abstract.d.ts +1 -0
- package/src/objects-interface/vertices/vertex.abstract.d.ts.map +1 -0
- package/src/shared/payload.abstract.d.ts +1 -0
- package/src/shared/payload.abstract.d.ts.map +1 -0
- package/src/shared/request.abstract.d.ts +1 -0
- package/src/shared/request.abstract.d.ts.map +1 -0
- package/src/shared/response.abstract.d.ts +1 -0
- package/src/shared/response.abstract.d.ts.map +1 -0
- package/tsconfig-lib.json +3 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/types/boolean.d.ts +19 -0
- package/types/string.d.ts +33 -0
|
@@ -1,44 +1,43 @@
|
|
|
1
1
|
import { Moment } from "moment";
|
|
2
2
|
import { LanguagePoint } from "#/index";
|
|
3
|
-
import {
|
|
4
|
-
import { WeekDayEnum } from "#/objects/datetime/points/week-day.enum";
|
|
3
|
+
import { HolidaysCountry } from "#/objects/datetime/edges/locale/holidays-country.type";
|
|
5
4
|
export declare class DatetimeEdge {
|
|
6
5
|
private readonly value?;
|
|
7
6
|
protected readonly date: Moment;
|
|
8
7
|
constructor(value?: (Date | string) | undefined);
|
|
9
8
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @returns
|
|
9
|
+
* Returns a human-friendly date string in the format "Day, Mon DD".
|
|
10
|
+
* Uses day and month names in the specified locale.
|
|
11
|
+
* @returns A formatted string such as "Sunday, Mar 29" or "Today, Apr 1"
|
|
13
12
|
* @example
|
|
14
|
-
* new DatetimeEdge(new Date("2026-03-29")).toFriendlyString() // "
|
|
15
|
-
* new DatetimeEdge(new Date()).toFriendlyString() // "
|
|
13
|
+
* new DatetimeEdge(new Date("2026-03-29")).toFriendlyString() // "Sunday, Mar 29"
|
|
14
|
+
* new DatetimeEdge(new Date()).toFriendlyString() // "Today, Apr 1"
|
|
16
15
|
*/
|
|
17
16
|
toFriendlyString(language: LanguagePoint): string;
|
|
18
17
|
/**
|
|
19
|
-
*
|
|
20
|
-
* @param
|
|
21
|
-
* @returns true
|
|
18
|
+
* Checks whether this date is later than another date.
|
|
19
|
+
* @param datetime - Date to compare against.
|
|
20
|
+
* @returns `true` if this date is greater than `datetime`; otherwise, `false`.
|
|
22
21
|
* @example
|
|
23
22
|
* new DatetimeEdge(new Date("2026-12-01")).isAfter(new DatetimeEdge(new Date("2026-01-01"))) // true
|
|
24
23
|
*/
|
|
25
|
-
isAfter(
|
|
24
|
+
isAfter(datetime: DatetimeEdge): boolean;
|
|
26
25
|
/**
|
|
27
|
-
*
|
|
28
|
-
* @param
|
|
29
|
-
* @returns true
|
|
26
|
+
* Checks whether this date is earlier than another date.
|
|
27
|
+
* @param datetime - Date to compare against.
|
|
28
|
+
* @returns `true` if this date is less than `datetime`; otherwise, `false`.
|
|
30
29
|
* @example
|
|
31
30
|
* new DatetimeEdge(new Date("2026-01-01")).isBefore(new DatetimeEdge(new Date("2026-12-01"))) // true
|
|
32
31
|
*/
|
|
33
|
-
isBefore(
|
|
32
|
+
isBefore(datetime: DatetimeEdge): boolean;
|
|
34
33
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @param
|
|
37
|
-
* @returns true
|
|
34
|
+
* Checks whether this date is equal to another date.
|
|
35
|
+
* @param datetime - Date to compare against.
|
|
36
|
+
* @returns `true` if the dates are equal; otherwise, `false`.
|
|
38
37
|
* @example
|
|
39
38
|
* new DatetimeEdge(new Date("2026-01-01")).isEquals(new DatetimeEdge(new Date("2026-01-01"))) // true
|
|
40
39
|
*/
|
|
41
|
-
isEquals(
|
|
40
|
+
isEquals(datetime: DatetimeEdge): boolean;
|
|
42
41
|
/**
|
|
43
42
|
* Verifica se esta data está entre duas outras datas (exclusivo).
|
|
44
43
|
* @param initialDate - Data inicial do intervalo
|
|
@@ -52,382 +51,394 @@ export declare class DatetimeEdge {
|
|
|
52
51
|
*/
|
|
53
52
|
isBetween(initialDate: DatetimeEdge, finalDate: DatetimeEdge): boolean;
|
|
54
53
|
/**
|
|
55
|
-
*
|
|
56
|
-
* @returns true
|
|
54
|
+
* Checks whether this date falls on a weekend (Saturday or Sunday).
|
|
55
|
+
* @returns `true` if the date is a Saturday or Sunday; otherwise, `false`.
|
|
57
56
|
* @example
|
|
58
|
-
* new DatetimeEdge(new Date("2026-03-14")).isWeekend() // true (
|
|
59
|
-
* new DatetimeEdge(new Date("2026-03-12")).isWeekend() // false (
|
|
57
|
+
* new DatetimeEdge(new Date("2026-03-14")).isWeekend() // true (Saturday)
|
|
58
|
+
* new DatetimeEdge(new Date("2026-03-12")).isWeekend() // false (Thursday)
|
|
60
59
|
*/
|
|
61
60
|
isWeekend(): boolean;
|
|
62
61
|
/**
|
|
63
|
-
*
|
|
64
|
-
* @
|
|
62
|
+
* Checks whether this date is a holiday in the specified country.
|
|
63
|
+
* @param country - The country whose holiday calendar will be used for validation.
|
|
64
|
+
* @returns `true` if the date is a holiday in the specified country; otherwise, `false`.
|
|
65
65
|
* @example
|
|
66
|
-
* new DatetimeEdge(new Date("2026-12-25")).isHoliday() // true (
|
|
67
|
-
* new DatetimeEdge(new Date("2026-03-12")).isHoliday() // false
|
|
66
|
+
* new DatetimeEdge(new Date("2026-12-25")).isHoliday("BR") // true (Christmas Day)
|
|
67
|
+
* new DatetimeEdge(new Date("2026-03-12")).isHoliday("BR") // false
|
|
68
68
|
*/
|
|
69
|
-
isHoliday(): boolean;
|
|
69
|
+
isHoliday(country: HolidaysCountry): boolean;
|
|
70
70
|
/**
|
|
71
|
-
*
|
|
72
|
-
* @
|
|
71
|
+
* Checks whether the date is a business day (not a weekend or a holiday).
|
|
72
|
+
* @param country - The country whose holiday calendar will be used for validation.
|
|
73
|
+
* @returns `true` if the date is a business day; otherwise, `false`.
|
|
73
74
|
* @example
|
|
74
|
-
* new DatetimeEdge(new Date("2026-03-12")).isBusinessDay() // true (
|
|
75
|
-
* new DatetimeEdge(new Date("2026-12-25")).isBusinessDay() // false (
|
|
75
|
+
* new DatetimeEdge(new Date("2026-03-12")).isBusinessDay("BR") // true (Thursday)
|
|
76
|
+
* new DatetimeEdge(new Date("2026-12-25")).isBusinessDay("BR") // false (Christmas Day)
|
|
76
77
|
*/
|
|
77
|
-
isBusinessDay(): boolean;
|
|
78
|
+
isBusinessDay(country: HolidaysCountry): boolean;
|
|
78
79
|
/**
|
|
79
|
-
*
|
|
80
|
-
* @returns true
|
|
80
|
+
* Checks whether the date corresponds to today.
|
|
81
|
+
* @returns `true` if the date is today; otherwise, `false`.
|
|
81
82
|
* @example
|
|
82
83
|
* new DatetimeEdge(new Date()).isToday() // true
|
|
83
84
|
* new DatetimeEdge(new Date("2020-01-01")).isToday() // false
|
|
84
85
|
*/
|
|
85
86
|
isToday(): boolean;
|
|
86
87
|
/**
|
|
87
|
-
*
|
|
88
|
-
* @returns true
|
|
88
|
+
* Checks whether the date corresponds to yesterday.
|
|
89
|
+
* @returns `true` if the date is yesterday; otherwise, `false`.
|
|
89
90
|
* @example
|
|
90
91
|
* new DatetimeEdge(new Date()).isYesterday() // false
|
|
91
92
|
*/
|
|
92
93
|
isYesterday(): boolean;
|
|
93
94
|
/**
|
|
94
|
-
*
|
|
95
|
-
* @returns true
|
|
95
|
+
* Checks whether the date corresponds to tomorrow.
|
|
96
|
+
* @returns `true` if the date is tomorrow; otherwise, `false`.
|
|
96
97
|
* @example
|
|
97
98
|
* new DatetimeEdge(new Date()).isTomorrow() // false
|
|
98
99
|
*/
|
|
99
100
|
isTomorrow(): boolean;
|
|
100
101
|
/**
|
|
101
|
-
*
|
|
102
|
-
* @param
|
|
103
|
-
* @returns true
|
|
102
|
+
* Checks whether the date is on the same day as another date.
|
|
103
|
+
* @param datetime - Date for comparison
|
|
104
|
+
* @returns `true` if both dates are on the same day, `false` otherwise
|
|
104
105
|
* @example
|
|
105
106
|
* const a = new DatetimeEdge(new Date("2026-03-12T08:00"));
|
|
106
107
|
* const b = new DatetimeEdge(new Date("2026-03-12T22:00"));
|
|
107
108
|
* a.isSameDay(b) // true
|
|
108
109
|
*/
|
|
109
|
-
isSameDay(
|
|
110
|
+
isSameDay(datetime: DatetimeEdge): boolean;
|
|
110
111
|
/**
|
|
111
|
-
*
|
|
112
|
-
* @param
|
|
113
|
-
* @returns true
|
|
112
|
+
* Checks whether the date is on the same month as another date.
|
|
113
|
+
* @param datetime - Date for comparison
|
|
114
|
+
* @returns `true` if both dates are on the same month and year, `false` otherwise
|
|
114
115
|
* @example
|
|
115
116
|
* const a = new DatetimeEdge(new Date("2026-03-01"));
|
|
116
117
|
* const b = new DatetimeEdge(new Date("2026-03-31"));
|
|
117
118
|
* a.isSameMonth(b) // true
|
|
118
119
|
*/
|
|
119
|
-
isSameMonth(
|
|
120
|
+
isSameMonth(datetime: DatetimeEdge): boolean;
|
|
120
121
|
/**
|
|
121
|
-
*
|
|
122
|
-
* @param
|
|
123
|
-
* @returns true
|
|
122
|
+
* Checks whether the date is on the same year as another date.
|
|
123
|
+
* @param datetime - Date for comparison
|
|
124
|
+
* @returns `true` if both dates are on the same year, `false` otherwise
|
|
124
125
|
* @example
|
|
125
126
|
* const a = new DatetimeEdge(new Date("2026-01-01"));
|
|
126
127
|
* const b = new DatetimeEdge(new Date("2026-12-31"));
|
|
127
128
|
* a.isSameYear(b) // true
|
|
128
129
|
*/
|
|
129
|
-
isSameYear(
|
|
130
|
+
isSameYear(datetime: DatetimeEdge): boolean;
|
|
130
131
|
/**
|
|
131
|
-
*
|
|
132
|
-
* @returns Enum WeekDayEnum
|
|
132
|
+
* Returns the day of the week for the date.
|
|
133
|
+
* @returns Enum WeekDayEnum representing the day of the week
|
|
133
134
|
* @example
|
|
134
135
|
* new DatetimeEdge(new Date("2026-03-12")).getDayOfWeek() // WeekDayEnum.thursday
|
|
135
136
|
*/
|
|
136
|
-
getDayOfWeek():
|
|
137
|
+
getDayOfWeek(language: LanguagePoint): string;
|
|
137
138
|
/**
|
|
138
|
-
*
|
|
139
|
-
*
|
|
139
|
+
* Returns the standard day of the week as a {@link WeekDayEnum} value.
|
|
140
|
+
* This internal method provides the canonical weekday representation
|
|
141
|
+
* used throughout the class before any localization or formatting is applied.
|
|
142
|
+
*
|
|
143
|
+
* @returns The corresponding {@link WeekDayEnum} for the current date.
|
|
144
|
+
* @example
|
|
145
|
+
* new DatetimeEdge(new Date("2026-03-12")).getStandardDayOfWeek() // WeekDayEnum.thursday
|
|
146
|
+
*/
|
|
147
|
+
private getStandardDayOfWeek;
|
|
148
|
+
/**
|
|
149
|
+
* Returns the name of the month for the date.
|
|
150
|
+
* @returns Enum MonthNameEnum representing the month
|
|
140
151
|
* @example
|
|
141
152
|
* new DatetimeEdge(new Date("2026-03-12")).getNameOfMonth() // MonthNameEnum.march
|
|
142
153
|
*/
|
|
143
|
-
getNameOfMonth():
|
|
154
|
+
getNameOfMonth(language: LanguagePoint): string;
|
|
144
155
|
/**
|
|
145
|
-
*
|
|
146
|
-
* @returns
|
|
156
|
+
* Returns the day of the month for the date.
|
|
157
|
+
* @returns NNumber of the day (1-31)
|
|
147
158
|
* @example
|
|
148
159
|
* new DatetimeEdge(new Date("2026-03-12")).getDayOfMonth() // 12
|
|
149
160
|
*/
|
|
150
161
|
getDayOfMonth(): number;
|
|
151
162
|
/**
|
|
152
|
-
*
|
|
153
|
-
* @returns
|
|
163
|
+
* Returns the month number for the date (0-11).
|
|
164
|
+
* @returns Month number (0=January, 11=December)
|
|
154
165
|
* @example
|
|
155
166
|
* new DatetimeEdge(new Date("2026-03-12")).getNumberOfMonth() // 2
|
|
156
167
|
*/
|
|
157
168
|
getNumberOfMonth(): number;
|
|
158
169
|
/**
|
|
159
|
-
*
|
|
160
|
-
* @returns
|
|
170
|
+
* Returns the year of the date.
|
|
171
|
+
* @returns The year number.
|
|
161
172
|
* @example
|
|
162
173
|
* new DatetimeEdge(new Date("2026-03-12")).getYear() // 2026
|
|
163
174
|
*/
|
|
164
175
|
getYear(): number;
|
|
165
176
|
/**
|
|
166
|
-
*
|
|
167
|
-
* @returns
|
|
177
|
+
* Returns the hours of the date.
|
|
178
|
+
* @returns The hour number (0-23)
|
|
168
179
|
* @example
|
|
169
180
|
* new DatetimeEdge(new Date("2026-03-12T14:30:00")).getHours() // 14
|
|
170
181
|
*/
|
|
171
182
|
getHours(): number;
|
|
172
183
|
/**
|
|
173
|
-
*
|
|
174
|
-
* @returns
|
|
184
|
+
* Returns the minutes of the date.
|
|
185
|
+
* @returns The minute number (0-59)
|
|
175
186
|
* @example
|
|
176
187
|
* new DatetimeEdge(new Date("2026-03-12T14:30:00")).getMinutes() // 30
|
|
177
188
|
*/
|
|
178
189
|
getMinutes(): number;
|
|
179
190
|
/**
|
|
180
|
-
*
|
|
181
|
-
* @returns
|
|
191
|
+
* Returns the seconds of the date.
|
|
192
|
+
* @returns The second number (0-59)
|
|
182
193
|
* @example
|
|
183
194
|
* new DatetimeEdge(new Date("2026-03-12T14:30:45")).getSeconds() // 45
|
|
184
195
|
*/
|
|
185
196
|
getSeconds(): number;
|
|
186
197
|
/**
|
|
187
|
-
*
|
|
188
|
-
* @param days -
|
|
189
|
-
* @returns
|
|
198
|
+
* Adds days to the date and returns a new instance.
|
|
199
|
+
* @param days - NNumber of days to add
|
|
200
|
+
* @returns New instance with the updated date
|
|
190
201
|
* @example
|
|
191
202
|
* new DatetimeEdge(new Date("2026-03-12")).addDays(5) // DatetimeEdge("2026-03-17")
|
|
192
203
|
*/
|
|
193
204
|
addDays(days: number): DatetimeEdge;
|
|
194
205
|
/**
|
|
195
|
-
*
|
|
196
|
-
* @param days -
|
|
197
|
-
* @returns
|
|
206
|
+
* Subtracts days from the date and returns a new instance.
|
|
207
|
+
* @param days - NNumber of days to subtract
|
|
208
|
+
* @returns New instance with the updated date
|
|
198
209
|
* @example
|
|
199
210
|
* new DatetimeEdge(new Date("2026-03-12")).subtractDays(5) // DatetimeEdge("2026-03-07")
|
|
200
211
|
*/
|
|
201
212
|
subtractDays(days: number): DatetimeEdge;
|
|
202
213
|
/**
|
|
203
|
-
*
|
|
204
|
-
* @param months -
|
|
205
|
-
* @returns
|
|
214
|
+
* Adds months to the date and returns a new instance.
|
|
215
|
+
* @param months - NNumber of months to add
|
|
216
|
+
* @returns New instance with the updated date
|
|
206
217
|
* @example
|
|
207
218
|
* new DatetimeEdge(new Date("2026-03-12")).addMonths(2) // DatetimeEdge("2026-05-12")
|
|
208
219
|
*/
|
|
209
220
|
addMonths(months: number): DatetimeEdge;
|
|
210
221
|
/**
|
|
211
|
-
*
|
|
212
|
-
* @param months -
|
|
213
|
-
* @returns
|
|
222
|
+
* Subtracts months from the date and returns a new instance.
|
|
223
|
+
* @param months - NNumber of months to subtract
|
|
224
|
+
* @returns New instance with the updated date
|
|
214
225
|
* @example
|
|
215
226
|
* new DatetimeEdge(new Date("2026-03-12")).subtractMonths(2) // DatetimeEdge("2026-01-12")
|
|
216
227
|
*/
|
|
217
228
|
subtractMonths(months: number): DatetimeEdge;
|
|
218
229
|
/**
|
|
219
|
-
*
|
|
220
|
-
* @param years -
|
|
221
|
-
* @returns
|
|
230
|
+
* Adds years to the date and returns a new instance.
|
|
231
|
+
* @param years - NNumber of years to add
|
|
232
|
+
* @returns New instance with the updated date
|
|
222
233
|
* @example
|
|
223
234
|
* new DatetimeEdge(new Date("2026-03-12")).addYears(1) // DatetimeEdge("2027-03-12")
|
|
224
235
|
*/
|
|
225
236
|
addYears(years: number): DatetimeEdge;
|
|
226
237
|
/**
|
|
227
|
-
*
|
|
228
|
-
* @param years -
|
|
229
|
-
* @returns
|
|
238
|
+
* Subtracts years from the date and returns a new instance.
|
|
239
|
+
* @param years - NNumber of years to subtract
|
|
240
|
+
* @returns New instance with the updated date
|
|
230
241
|
* @example
|
|
231
242
|
* new DatetimeEdge(new Date("2026-03-12")).subtractYears(1) // DatetimeEdge("2025-03-12")
|
|
232
243
|
*/
|
|
233
244
|
subtractYears(years: number): DatetimeEdge;
|
|
234
245
|
/**
|
|
235
|
-
*
|
|
236
|
-
* @param hours -
|
|
237
|
-
* @returns
|
|
246
|
+
* Adds hours to the date and returns a new instance.
|
|
247
|
+
* @param hours - NNumber of hours to add
|
|
248
|
+
* @returns New instance with the updated date
|
|
238
249
|
* @example
|
|
239
250
|
* new DatetimeEdge(new Date("2026-03-12T08:00")).addHours(3) // DatetimeEdge("2026-03-12T11:00")
|
|
240
251
|
*/
|
|
241
252
|
addHours(hours: number): DatetimeEdge;
|
|
242
253
|
/**
|
|
243
|
-
*
|
|
244
|
-
* @param minutes -
|
|
245
|
-
* @returns
|
|
254
|
+
* Adds minutes to the date and returns a new instance.
|
|
255
|
+
* @param minutes - NNumber of minutes to add
|
|
256
|
+
* @returns New instance with the updated date
|
|
246
257
|
* @example
|
|
247
258
|
* new DatetimeEdge(new Date("2026-03-12T08:00")).addMinutes(30) // DatetimeEdge("2026-03-12T08:30")
|
|
248
259
|
*/
|
|
249
260
|
addMinutes(minutes: number): DatetimeEdge;
|
|
250
261
|
/**
|
|
251
|
-
*
|
|
252
|
-
* @param
|
|
253
|
-
* @returns
|
|
262
|
+
* Calculates the difference in days between this date and another.
|
|
263
|
+
* @param datetime - Date to calculate the difference from
|
|
264
|
+
* @returns NNumber of days difference (positive if this > datetime)
|
|
254
265
|
* @example
|
|
255
266
|
* new DatetimeEdge(new Date("2026-03-15")).diffInDays(new DatetimeEdge(new Date("2026-03-10"))) // 5
|
|
256
267
|
*/
|
|
257
|
-
diffInDays(
|
|
268
|
+
diffInDays(datetime: DatetimeEdge): number;
|
|
258
269
|
/**
|
|
259
|
-
*
|
|
260
|
-
* @param
|
|
261
|
-
* @returns
|
|
270
|
+
* Calculates the difference in months between this date and another.
|
|
271
|
+
* @param datetime - Date to calculate the difference from
|
|
272
|
+
* @returns NNumber of months difference (positive if this > datetime)
|
|
262
273
|
* @example
|
|
263
274
|
* new DatetimeEdge(new Date("2026-05-12")).diffInMonths(new DatetimeEdge(new Date("2026-03-12"))) // 2
|
|
264
275
|
*/
|
|
265
|
-
diffInMonths(
|
|
276
|
+
diffInMonths(datetime: DatetimeEdge): number;
|
|
266
277
|
/**
|
|
267
|
-
*
|
|
268
|
-
* @param
|
|
269
|
-
* @returns
|
|
278
|
+
* Calculates the difference in years between this date and another date.
|
|
279
|
+
* @param datetime - Date to calculate the difference against.
|
|
280
|
+
* @returns The number of years between the dates (positive if this date is later than `datetime`).
|
|
270
281
|
* @example
|
|
271
282
|
* new DatetimeEdge(new Date("2028-03-12")).diffInYears(new DatetimeEdge(new Date("2026-03-12"))) // 2
|
|
272
283
|
*/
|
|
273
|
-
diffInYears(
|
|
284
|
+
diffInYears(datetime: DatetimeEdge): number;
|
|
274
285
|
/**
|
|
275
286
|
* Calcula a diferença em horas entre esta data e outra.
|
|
276
|
-
* @param
|
|
277
|
-
* @returns Número de horas de diferença (positivo se this >
|
|
287
|
+
* @param datetime - Data para calcular a diferença
|
|
288
|
+
* @returns Número de horas de diferença (positivo se this > datetime)
|
|
278
289
|
* @example
|
|
279
290
|
* new DatetimeEdge(new Date("2026-03-12T14:00")).diffInHours(new DatetimeEdge(new Date("2026-03-12T08:00"))) // 6
|
|
280
291
|
*/
|
|
281
|
-
diffInHours(
|
|
292
|
+
diffInHours(datetime: DatetimeEdge): number;
|
|
282
293
|
/**
|
|
283
|
-
*
|
|
284
|
-
* @param
|
|
285
|
-
* @returns
|
|
294
|
+
* Calculates the difference in minutes between this date and another date.
|
|
295
|
+
* @param datetime - Date to calculate the difference against.
|
|
296
|
+
* @returns The number of minutes between the dates (positive if this date is later than `datetime`).
|
|
286
297
|
* @example
|
|
287
298
|
* new DatetimeEdge(new Date("2026-03-12T08:45")).diffInMinutes(new DatetimeEdge(new Date("2026-03-12T08:00"))) // 45
|
|
288
299
|
*/
|
|
289
|
-
diffInMinutes(
|
|
300
|
+
diffInMinutes(datetime: DatetimeEdge): number;
|
|
290
301
|
/**
|
|
291
|
-
*
|
|
292
|
-
* @returns
|
|
302
|
+
* Returns a human-readable difference between this date and the current moment.
|
|
303
|
+
* @returns A descriptive string such as "3 days ago.", "2 hours ago.", etc.
|
|
293
304
|
* @example
|
|
294
|
-
* new DatetimeEdge(new Date("2025-03-12")).diffFromNow() // "
|
|
305
|
+
* new DatetimeEdge(new Date("2025-03-12")).diffFromNow() // "1 year ago."
|
|
295
306
|
*/
|
|
296
307
|
diffFromNow(): string;
|
|
297
308
|
/**
|
|
298
|
-
*
|
|
299
|
-
* @returns
|
|
309
|
+
* Returns the start of the day (00:00:00.000) as a new instance.
|
|
310
|
+
* @returns A new instance with the time set to the beginning of the day
|
|
300
311
|
* @example
|
|
301
312
|
* new DatetimeEdge(new Date("2026-03-12T14:30")).startOfDay()
|
|
302
313
|
* // DatetimeEdge("2026-03-12T00:00:00.000")
|
|
303
314
|
*/
|
|
304
315
|
startOfDay(): DatetimeEdge;
|
|
305
316
|
/**
|
|
306
|
-
*
|
|
307
|
-
* @returns
|
|
317
|
+
* Returns the end of the day (23:59:59.999) as a new instance.
|
|
318
|
+
* @returns A new instance with the time set to the end of the day
|
|
308
319
|
* @example
|
|
309
320
|
* new DatetimeEdge(new Date("2026-03-12T08:00")).endOfDay()
|
|
310
321
|
* // DatetimeEdge("2026-03-12T23:59:59.999")
|
|
311
322
|
*/
|
|
312
323
|
endOfDay(): DatetimeEdge;
|
|
313
324
|
/**
|
|
314
|
-
*
|
|
315
|
-
* @returns
|
|
325
|
+
* Returns the start of the month as a new instance.
|
|
326
|
+
* @returns A new instance pointing to the first day of the month at midnight
|
|
316
327
|
* @example
|
|
317
328
|
* new DatetimeEdge(new Date("2026-03-12")).startOfMonth()
|
|
318
329
|
* // DatetimeEdge("2026-03-01T00:00:00.000")
|
|
319
330
|
*/
|
|
320
331
|
startOfMonth(): DatetimeEdge;
|
|
321
332
|
/**
|
|
322
|
-
*
|
|
323
|
-
* @returns
|
|
333
|
+
* Returns the end of the month as a new instance.
|
|
334
|
+
* @returns A new instance pointing to the last day of the month at the end of the day
|
|
324
335
|
* @example
|
|
325
336
|
* new DatetimeEdge(new Date("2026-03-12")).endOfMonth()
|
|
326
337
|
* // DatetimeEdge("2026-03-31T23:59:59.999")
|
|
327
338
|
*/
|
|
328
339
|
endOfMonth(): DatetimeEdge;
|
|
329
340
|
/**
|
|
330
|
-
*
|
|
331
|
-
* @returns
|
|
341
|
+
* Returns the start of the year as a new instance.
|
|
342
|
+
* @returns A new instance pointing to the first day of the year at midnight
|
|
332
343
|
* @example
|
|
333
344
|
* new DatetimeEdge(new Date("2026-03-12")).startOfYear()
|
|
334
345
|
* // DatetimeEdge("2026-01-01T00:00:00.000")
|
|
335
346
|
*/
|
|
336
347
|
startOfYear(): DatetimeEdge;
|
|
337
348
|
/**
|
|
338
|
-
*
|
|
339
|
-
* @returns
|
|
349
|
+
* Returns the end of the year as a new instance.
|
|
350
|
+
* @returns A new instance pointing to the last day of the year at the end of the day
|
|
340
351
|
* @example
|
|
341
352
|
* new DatetimeEdge(new Date("2026-03-12")).endOfYear()
|
|
342
353
|
* // DatetimeEdge("2026-12-31T23:59:59.999")
|
|
343
354
|
*/
|
|
344
355
|
endOfYear(): DatetimeEdge;
|
|
345
356
|
/**
|
|
346
|
-
*
|
|
347
|
-
* @returns
|
|
357
|
+
* Creates an independent copy of this DatetimeEdge instance.
|
|
358
|
+
* @returns A new instance with the same date value
|
|
348
359
|
* @example
|
|
349
360
|
* const dt1 = new DatetimeEdge(new Date("2026-03-12"));
|
|
350
|
-
* const dt2 = dt1.clone(); //
|
|
361
|
+
* const dt2 = dt1.clone(); // independent instance
|
|
351
362
|
*/
|
|
352
363
|
clone(): DatetimeEdge;
|
|
353
364
|
/**
|
|
354
|
-
*
|
|
355
|
-
* @param date -
|
|
356
|
-
* @returns
|
|
365
|
+
* Returns a new instance with the date changed, keeping the time.
|
|
366
|
+
* @param date - New Date object
|
|
367
|
+
* @returns New instance with the provided value
|
|
357
368
|
* @example
|
|
358
369
|
* new DatetimeEdge(new Date("2026-03-12")).withDate(new Date("2026-12-25"))
|
|
359
370
|
* // DatetimeEdge("2026-12-25")
|
|
360
371
|
*/
|
|
361
372
|
withDate(date: Date): DatetimeEdge;
|
|
362
373
|
/**
|
|
363
|
-
*
|
|
364
|
-
* @returns String
|
|
374
|
+
* Returns the date in ISO 8601 format.
|
|
375
|
+
* @returns String in the format "YYYY-MM-DDTHH:mm:ss.sssZ"
|
|
365
376
|
* @example
|
|
366
377
|
* new DatetimeEdge(new Date("2026-03-12")).toISOString() // "2026-03-12T00:00:00.000Z"
|
|
367
378
|
*/
|
|
368
379
|
toISOString(): string;
|
|
369
380
|
/**
|
|
370
|
-
*
|
|
371
|
-
* @returns
|
|
381
|
+
* Returns the date as a native Date object.
|
|
382
|
+
* @returns Date object representing this date
|
|
372
383
|
* @example
|
|
373
384
|
* new DatetimeEdge(new Date("2026-03-12")).toDate() // Date object
|
|
374
385
|
*/
|
|
375
386
|
toDate(): Date;
|
|
376
387
|
/**
|
|
377
|
-
*
|
|
378
|
-
* @returns String
|
|
388
|
+
* Returns the date in YYYY-MM-DD format.
|
|
389
|
+
* @returns String in the format "YYYY-MM-DD"
|
|
379
390
|
* @example
|
|
380
391
|
* new DatetimeEdge(new Date("2026-03-12")).toYYYYMMDD() // "2026-03-12"
|
|
381
392
|
*/
|
|
382
393
|
toYYYYMMDD(): string;
|
|
383
394
|
/**
|
|
384
|
-
*
|
|
395
|
+
* Returns the date in DD/MM/YYYY format (Brazilian standard).
|
|
385
396
|
* @returns String no formato "DD/MM/YYYY"
|
|
386
397
|
* @example
|
|
387
398
|
* new DatetimeEdge(new Date("2026-03-12")).toDDMMYYYY() // "12/03/2026"
|
|
388
399
|
*/
|
|
389
400
|
toDDMMYYYY(): string;
|
|
390
401
|
/**
|
|
391
|
-
*
|
|
392
|
-
* @returns
|
|
402
|
+
* Returns the date and time in the format DD/MM/YYYY HH:mm.
|
|
403
|
+
* @returns A string in the format "DD/MM/YYYY HH:mm".
|
|
393
404
|
* @example
|
|
394
405
|
* new DatetimeEdge(new Date("2026-03-12T14:30")).toDDMMYYYYHHmm() // "12/03/2026 14:30"
|
|
395
406
|
*/
|
|
396
407
|
toDDMMYYYYHHmm(): string;
|
|
397
408
|
/**
|
|
398
|
-
*
|
|
399
|
-
* @param format -
|
|
400
|
-
* @returns
|
|
409
|
+
* Returns the date formatted with a custom pattern from moment.js.
|
|
410
|
+
* @param format - Formatting pattern (e.g., "YYYY-MM-DD HH:mm:ss")
|
|
411
|
+
* @returns Formatted string according to the provided pattern
|
|
401
412
|
* @example
|
|
402
413
|
* new DatetimeEdge(new Date("2026-03-12T14:30")).format("MMMM Do YYYY") // "March 12th 2026"
|
|
403
414
|
*/
|
|
404
415
|
format(format: string): string;
|
|
405
416
|
/**
|
|
406
|
-
*
|
|
407
|
-
* @returns
|
|
417
|
+
* Returns the timestamp in milliseconds of the date.
|
|
418
|
+
* @returns NNumber of milliseconds since 01/01/1970 UTC
|
|
408
419
|
* @example
|
|
409
420
|
* new DatetimeEdge(new Date("2026-03-12")).timestamp() // 1773273600000
|
|
410
421
|
*/
|
|
411
422
|
timestamp(): number;
|
|
412
423
|
/**
|
|
413
|
-
*
|
|
414
|
-
* @returns
|
|
424
|
+
* Returns the Unix timestamp in seconds of the date.
|
|
425
|
+
* @returns NNumber of seconds since 01/01/1970 UTC
|
|
415
426
|
* @example
|
|
416
427
|
* new DatetimeEdge(new Date("2026-03-12")).unix() // 1773273600
|
|
417
428
|
*/
|
|
418
429
|
unix(): number;
|
|
419
430
|
/**
|
|
420
|
-
*
|
|
421
|
-
* @returns
|
|
431
|
+
* Creates a new DatetimeEdge representing the current moment.
|
|
432
|
+
* @returns New instance with the current date and time
|
|
422
433
|
* @example
|
|
423
|
-
* DatetimeEdge.now() // DatetimeEdge
|
|
434
|
+
* DatetimeEdge.now() // DatetimeEdge with the current date and time
|
|
424
435
|
*/
|
|
425
436
|
static now(): DatetimeEdge;
|
|
426
437
|
/**
|
|
427
|
-
*
|
|
428
|
-
* @param dates - Array
|
|
429
|
-
* @returns
|
|
430
|
-
* @throws {Error}
|
|
438
|
+
* Returns the latest (most recent) date from an array.
|
|
439
|
+
* @param dates - Array of DatetimeEdge instances to compare
|
|
440
|
+
* @returns The instance with the latest date
|
|
441
|
+
* @throws {Error} If the array is empty
|
|
431
442
|
* @example
|
|
432
443
|
* DatetimeEdge.max([
|
|
433
444
|
* new DatetimeEdge(new Date("2026-01-01")),
|
|
@@ -436,10 +447,10 @@ export declare class DatetimeEdge {
|
|
|
436
447
|
*/
|
|
437
448
|
static max(dates: DatetimeEdge[]): DatetimeEdge;
|
|
438
449
|
/**
|
|
439
|
-
*
|
|
440
|
-
* @param dates - Array
|
|
441
|
-
* @returns
|
|
442
|
-
* @throws {Error}
|
|
450
|
+
* Returns the earliest (oldest) date from an array.
|
|
451
|
+
* @param dates - Array of DatetimeEdge instances to compare
|
|
452
|
+
* @returns The instance with the earliest date
|
|
453
|
+
* @throws {Error} If the array is empty
|
|
443
454
|
* @example
|
|
444
455
|
* DatetimeEdge.min([
|
|
445
456
|
* new DatetimeEdge(new Date("2026-01-01")),
|
|
@@ -448,8 +459,9 @@ export declare class DatetimeEdge {
|
|
|
448
459
|
*/
|
|
449
460
|
static min(dates: DatetimeEdge[]): DatetimeEdge;
|
|
450
461
|
/**
|
|
451
|
-
*
|
|
452
|
-
* @throws {Error}
|
|
462
|
+
* Validates whether the date provided to the constructor is a valid date.
|
|
463
|
+
* @throws {Error} If the date is invalid.
|
|
453
464
|
*/
|
|
454
465
|
protected validate(): void;
|
|
455
466
|
}
|
|
467
|
+
//# sourceMappingURL=datetime.edge.d.ts.map
|