(parts: Partial<DateTime.PartsForMath>): <A extends DateTime>(
self: A
) => A
<A extends DateTime>(self: A, parts: Partial<DateTime.PartsForMath>): ASubtracts the given amount of unit from a DateTime.
Example (Subtracting date and time parts)
import { DateTime } from "effect"
// subtract 5 minutes
DateTime.makeUnsafe(0).pipe(
DateTime.subtract({ minutes: 5 })
)export const const subtract: {
(parts: Partial<DateTime.PartsForMath>): <
A extends DateTime
>(
self: A
) => A
<A extends DateTime>(
self: A,
parts: Partial<DateTime.PartsForMath>
): A
}
Subtracts the given amount of unit from a DateTime.
Example (Subtracting date and time parts)
import { DateTime } from "effect"
// subtract 5 minutes
DateTime.makeUnsafe(0).pipe(
DateTime.subtract({ minutes: 5 })
)
subtract: {
(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 subtract: {
(
parts: Partial<DateTime.DateTime.PartsForMath>
): <A extends DateTime.DateTime>(self: A) => A
<A extends DateTime.DateTime>(
self: A,
parts: Partial<DateTime.DateTime.PartsForMath>
): A
}
subtract