is_xxx_day: Is a 'datey' the start (or end) or middle of a day?

is_xxx_dayR Documentation

Is a datey the start (or end) or middle of a day?

Description

is_start_day() checks whether x is the start or end of a day.

is_mid_day() checks whether x is the middle of a day.

These properties are not necessarily preserved when a duration of n years is added or subtracted.

Usage

is_start_day(x)

is_mid_day(x)

Arguments

x

The datey to test.

Value

A vector of logical. Elements of the datey vector that are NA_datey_ will result in NA elements of the result vector.

See Also

datey

Examples

# Create (NA, 0 days, 1/4 day, 1/2 day):
t <- datey(c(NA_real_, 2000, 2000 + 0.25/366, 2000 + 0.5/366))
t # <NA>  2000-01-01.0  2000-01-01.25 2000-01-01.5

is_start_day(t) # NA  TRUE FALSE FALSE
is_mid_day(t)   # NA FALSE FALSE  TRUE

# Properties are not necessarily preserved between years:
t <- start_day(2000,7,1) # Leap year
is_start_day(t) # TRUE
is_start_day(t + durationy(1)) # FALSE

datey documentation built on July 14, 2026, 5:06 p.m.