@@ -175,6 +175,25 @@ is_year_month_weekday <- function(x) {
175175
176176# ------------------------------------------------------------------------------
177177
178+ # ' @export
179+ vec_ptype.clock_year_month_weekday <- function (x , ... ) {
180+ switch (
181+ calendar_precision(x ) + 1L ,
182+ clock_empty_year_month_weekday_year ,
183+ abort(" Internal error: Invalid precision" ),
184+ clock_empty_year_month_weekday_month ,
185+ abort(" Internal error: Invalid precision" ),
186+ clock_empty_year_month_weekday_day ,
187+ clock_empty_year_month_weekday_hour ,
188+ clock_empty_year_month_weekday_minute ,
189+ clock_empty_year_month_weekday_second ,
190+ clock_empty_year_month_weekday_millisecond ,
191+ clock_empty_year_month_weekday_microsecond ,
192+ clock_empty_year_month_weekday_nanosecond ,
193+ abort(" Internal error: Invalid precision." )
194+ )
195+ }
196+
178197# ' @export
179198vec_ptype2.clock_year_month_weekday.clock_year_month_weekday <- function (x , y , ... ) {
180199 ptype2_calendar_and_calendar(x , y , ... )
@@ -1050,3 +1069,21 @@ seq.clock_year_month_weekday <- function(from,
10501069 ... ) {
10511070 seq.clock_year_month_day(from , to , by , length.out , along.with , ... )
10521071}
1072+
1073+ # ------------------------------------------------------------------------------
1074+
1075+ clock_init_year_month_weekday_utils <- function (env ) {
1076+ year <- year_month_weekday(integer())
1077+
1078+ assign(" clock_empty_year_month_weekday_year" , year , envir = env )
1079+ assign(" clock_empty_year_month_weekday_month" , calendar_widen(year , " month" ), envir = env )
1080+ assign(" clock_empty_year_month_weekday_day" , calendar_widen(year , " day" ), envir = env )
1081+ assign(" clock_empty_year_month_weekday_hour" , calendar_widen(year , " hour" ), envir = env )
1082+ assign(" clock_empty_year_month_weekday_minute" , calendar_widen(year , " minute" ), envir = env )
1083+ assign(" clock_empty_year_month_weekday_second" , calendar_widen(year , " second" ), envir = env )
1084+ assign(" clock_empty_year_month_weekday_millisecond" , calendar_widen(year , " millisecond" ), envir = env )
1085+ assign(" clock_empty_year_month_weekday_microsecond" , calendar_widen(year , " microsecond" ), envir = env )
1086+ assign(" clock_empty_year_month_weekday_nanosecond" , calendar_widen(year , " nanosecond" ), envir = env )
1087+
1088+ invisible (NULL )
1089+ }
0 commit comments