JS.Temporal.PlainDateTime
- Package
- purescript-js-temporal
- Repository
- pete-murphy/purescript-js-temporal
A date and time (year, month, day, hour, minute, etc.) without time zone. Use for wall-clock times that are not tied to a specific instant (e.g. "Jan 15, 2024 at 3pm"). Combine with a time zone to get a ZonedDateTime.
#new Source
new :: forall provided rest. Union provided rest PlainDateTimeComponents => Record provided -> Effect PlainDateTimeCreates a PlainDateTime from component fields. Corresponds to Temporal.PlainDateTime().
#from Source
from :: forall provided. ConvertOptionsWithDefaults ToOverflowOptions (Record OverflowOptions) (Record provided) (Record OverflowOptions) => Record provided -> String -> Effect PlainDateTimeParses a date-time string (e.g. "2024-01-15T15:30:00"). Options: overflow.
#year Source
year :: PlainDateTime -> Int#month Source
month :: PlainDateTime -> Int#day Source
day :: PlainDateTime -> Int#monthCode Source
monthCode :: PlainDateTime -> String#dayOfWeek Source
dayOfWeek :: PlainDateTime -> Int#dayOfYear Source
dayOfYear :: PlainDateTime -> Int#weekOfYear Source
weekOfYear :: PlainDateTime -> Maybe Int#yearOfWeek Source
yearOfWeek :: PlainDateTime -> Maybe Int#daysInMonth Source
daysInMonth :: PlainDateTime -> Int#daysInYear Source
daysInYear :: PlainDateTime -> Int#daysInWeek Source
daysInWeek :: PlainDateTime -> Int#monthsInYear Source
monthsInYear :: PlainDateTime -> Int#inLeapYear Source
inLeapYear :: PlainDateTime -> Boolean#calendarId Source
calendarId :: PlainDateTime -> String#hour Source
hour :: PlainDateTime -> Int#minute Source
minute :: PlainDateTime -> Int#second Source
second :: PlainDateTime -> Int#millisecond Source
millisecond :: PlainDateTime -> Int#microsecond Source
microsecond :: PlainDateTime -> Int#nanosecond Source
nanosecond :: PlainDateTime -> Int#add Source
add :: forall provided. ConvertOptionsWithDefaults ToOverflowOptions (Record OverflowOptions) (Record provided) (Record OverflowOptions) => Record provided -> Duration -> PlainDateTime -> Effect PlainDateTimeAdds a duration. Supports calendar durations. Options: overflow.
#add_ Source
add_ :: Duration -> PlainDateTime -> Effect PlainDateTimeSame as add with default options.
#subtract Source
subtract :: forall provided. ConvertOptionsWithDefaults ToOverflowOptions (Record OverflowOptions) (Record provided) (Record OverflowOptions) => Record provided -> Duration -> PlainDateTime -> Effect PlainDateTimeSubtracts a duration. Options: overflow.
#subtract_ Source
subtract_ :: Duration -> PlainDateTime -> Effect PlainDateTimeSame as subtract with default options.
#with Source
with :: forall optsProvided fields rest. Union fields rest WithFields => ConvertOptionsWithDefaults ToOverflowOptions (Record OverflowOptions) (Record optsProvided) (Record OverflowOptions) => Record optsProvided -> Record fields -> PlainDateTime -> Effect PlainDateTime#with_ Source
with_ :: forall fields rest. Union fields rest WithFields => Record fields -> PlainDateTime -> Effect PlainDateTime#withCalendar Source
withCalendar :: String -> PlainDateTime -> Effect PlainDateTime#until Source
until :: forall provided. ConvertOptionsWithDefaults ToDifferenceOptions (Record DifferenceOptions) (Record provided) (Record DifferenceOptions) => Record provided -> PlainDateTime -> PlainDateTime -> Effect Duration#until_ Source
until_ :: PlainDateTime -> PlainDateTime -> Effect Duration#since Source
since :: forall provided. ConvertOptionsWithDefaults ToDifferenceOptions (Record DifferenceOptions) (Record provided) (Record DifferenceOptions) => Record provided -> PlainDateTime -> PlainDateTime -> Effect Duration#since_ Source
since_ :: PlainDateTime -> PlainDateTime -> Effect Duration#round Source
round :: forall provided. ConvertOptionsWithDefaults ToRoundOptions (Record RoundOptions) (Record provided) (Record RoundOptions) => Record provided -> PlainDateTime -> Effect PlainDateTime#toString Source
toString :: forall provided. ConvertOptionsWithDefaults ToToStringOptions (Record ToStringOptions) (Record provided) (Record ToStringOptions) => Record provided -> PlainDateTime -> StringSerializes to ISO 8601 format. Options: fractionalSecondDigits, smallestUnit, roundingMode, calendarName.
#toString_ Source
toString_ :: PlainDateTime -> StringDefault ISO 8601 serialization (no options). Prefer over toString {}.
#fromDateTime Source
fromDateTime :: DateTime -> Effect PlainDateTimeConverts a purescript-datetime DateTime to a PlainDateTime.
See docs/purescript-datetime-interop.md.
#toDateTime Source
toDateTime :: PlainDateTime -> DateTimeConverts a PlainDateTime to a purescript-datetime DateTime.
See docs/purescript-datetime-interop.md.
#toPlainDate Source
toPlainDate :: PlainDateTime -> PlainDateExtracts the date component.
#toPlainTime Source
toPlainTime :: PlainDateTime -> PlainTimeExtracts the time component.
#toZonedDateTime Source
toZonedDateTime :: String -> PlainDateTime -> Effect ZonedDateTimeInterprets this date-time as occurring in the given time zone.
#ToOverflowOptions Source
data ToOverflowOptionsInstances
ConvertOption ToOverflowOptions "overflow" Overflow StringConvertOption ToOverflowOptions "overflow" String String
#ToDifferenceOptions Source
data ToDifferenceOptionsInstances
ConvertOption ToDifferenceOptions "largestUnit" TemporalUnit StringConvertOption ToDifferenceOptions "largestUnit" String StringConvertOption ToDifferenceOptions "smallestUnit" TemporalUnit StringConvertOption ToDifferenceOptions "smallestUnit" String StringConvertOption ToDifferenceOptions "roundingIncrement" Int IntConvertOption ToDifferenceOptions "roundingMode" RoundingMode StringConvertOption ToDifferenceOptions "roundingMode" String String
#ToRoundOptions Source
data ToRoundOptionsInstances
ConvertOption ToRoundOptions "smallestUnit" TemporalUnit StringConvertOption ToRoundOptions "smallestUnit" String StringConvertOption ToRoundOptions "roundingIncrement" Int IntConvertOption ToRoundOptions "roundingMode" RoundingMode StringConvertOption ToRoundOptions "roundingMode" String String
#ToToStringOptions Source
data ToToStringOptionsInstances
ConvertOption ToToStringOptions "calendarName" CalendarName StringConvertOption ToToStringOptions "calendarName" String StringConvertOption ToToStringOptions "fractionalSecondDigits" Int ForeignConvertOption ToToStringOptions "fractionalSecondDigits" String ForeignConvertOption ToToStringOptions "smallestUnit" TemporalUnit StringConvertOption ToToStringOptions "smallestUnit" String StringConvertOption ToToStringOptions "roundingMode" RoundingMode StringConvertOption ToToStringOptions "roundingMode" String String
Re-exports from JS.Temporal.PlainDateTime.Internal
- Modules
- JS.
Temporal. CalendarName - JS.
Temporal. Disambiguation - JS.
Temporal. Duration - JS.
Temporal. Duration. Internal - JS.
Temporal. Instant - JS.
Temporal. Instant. Internal - JS.
Temporal. Internal - JS.
Temporal. Now - JS.
Temporal. OffsetDisambiguation - JS.
Temporal. Overflow - JS.
Temporal. PlainDate - JS.
Temporal. PlainDate. Internal - JS.
Temporal. PlainDateTime - JS.
Temporal. PlainDateTime. Internal - JS.
Temporal. PlainMonthDay - JS.
Temporal. PlainMonthDay. Internal - JS.
Temporal. PlainTime - JS.
Temporal. PlainTime. Internal - JS.
Temporal. PlainYearMonth - JS.
Temporal. PlainYearMonth. Internal - JS.
Temporal. RoundingMode - JS.
Temporal. TemporalUnit - JS.
Temporal. ZonedDateTime - JS.
Temporal. ZonedDateTime. Internal