as_weekday: Convert to a weekday

View source: R/weekday.R

as_weekdayR Documentation

Convert to a weekday

Description

as_weekday() converts to a weekday type. This is normally useful for converting to a weekday from a sys-time or naive-time. You can use this function along with the circular arithmetic that weekday implements to easily get to the "next Monday" or "previous Sunday".

Usage

as_weekday(x, ...)

Arguments

x

⁠[object]⁠

An object to convert to a weekday. Usually a sys-time or naive-time.

...

These dots are for future extensions and must be empty.

Value

A weekday.

Examples

x <- as_naive_time(year_month_day(2019, 01, 05))

# This is a Saturday!
as_weekday(x)

# See the examples in `?weekday` for more usage.

clock documentation built on Sept. 11, 2024, 8:39 p.m.