(parts: Partial<DateTime.PartsForMath>): <A extends DateTime>(
self: A
) => A
<A extends DateTime>(self: A, parts: Partial<DateTime.PartsForMath>): AAdds the given amount of unit to a DateTime.
Details
The time zone is taken into account when adding days, weeks, months, and years.
Example (Adding date and time parts)
import { DateTime } from "effect"
// add 5 minutes
DateTime.makeUnsafe(0).pipe(
DateTime.add({ minutes: 5 })
)export const const add: {
(parts: Partial<DateTime.PartsForMath>): <
A extends DateTime
>(
self: A
) => A
<A extends DateTime>(
self: A,
parts: Partial<DateTime.PartsForMath>
): A
}
Adds the given amount of unit to a DateTime.
Details
The time zone is taken into account when adding days, weeks, months, and
years.
Example (Adding date and time parts)
import { DateTime } from "effect"
// add 5 minutes
DateTime.makeUnsafe(0).pipe(
DateTime.add({ minutes: 5 })
)
add: {
(parts: Partial<DateTime.PartsForMath>parts: type Partial<T> = {
[P in keyof T]?: T[P] | undefined
}
Make all properties in T optional
Partial<DateTime.interface DateTime.PartsForMathPlural amount fields accepted by DateTime.add and DateTime.subtract.
Details
Each field represents the number of units to add or subtract for that part.
PartsForMath>): <function (type parameter) A in <A extends DateTime>(self: A): AA extends type DateTime = Utc | ZonedA DateTime represents a point in time. It can optionally have a time zone
associated with it.
Companion namespace containing the public helper types used by DateTime
constructors, parts APIs, formatting, and date/time arithmetic.
DateTime>(self: A extends DateTimeself: function (type parameter) A in <A extends DateTime>(self: A): AA) => function (type parameter) A in <A extends DateTime>(self: A): AA
<function (type parameter) A in <A extends DateTime>(self: A, parts: Partial<DateTime.PartsForMath>): AA extends type DateTime = Utc | ZonedA DateTime represents a point in time. It can optionally have a time zone
associated with it.
Companion namespace containing the public helper types used by DateTime
constructors, parts APIs, formatting, and date/time arithmetic.
DateTime>(self: A extends DateTimeself: function (type parameter) A in <A extends DateTime>(self: A, parts: Partial<DateTime.PartsForMath>): AA, parts: Partial<DateTime.PartsForMath>parts: type Partial<T> = {
[P in keyof T]?: T[P] | undefined
}
Make all properties in T optional
Partial<DateTime.interface DateTime.PartsForMathPlural amount fields accepted by DateTime.add and DateTime.subtract.
Details
Each field represents the number of units to add or subtract for that part.
PartsForMath>): function (type parameter) A in <A extends DateTime>(self: A, parts: Partial<DateTime.PartsForMath>): AA
} = import InternalInternal.const add: {
(
parts: Partial<DateTime.DateTime.PartsForMath>
): <A extends DateTime.DateTime>(self: A) => A
<A extends DateTime.DateTime>(
self: A,
parts: Partial<DateTime.DateTime.PartsForMath>
): A
}
add