Skip to content

Commit 15f4ce4

Browse files
author
Stefan Fleck
committed
removed unnecessary lubridate methods that were not used anyways (as_date and as_datetime are s4 generics)
1 parent 6c49b2a commit 15f4ce4

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

R/date_xx.R

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ print.date_xx <- function(
119119
#' @rdname as.Date.date_xx
120120
#' @name as.Date.date_xx
121121
#'
122-
#' @example
122+
#' @examples
123123
#' as.Date(date_yq(2017, 2))
124124
#' as.POSIXlt(date_yq(2017, 2))
125125
#'
@@ -128,24 +128,6 @@ print.date_xx <- function(
128128
#'
129129

130130

131-
#' @rdname as.Date.date_xx
132-
#' @export
133-
as_date.date_xx <- function(x, ...){
134-
assert_lubridate()
135-
as.Date(x, ...)
136-
}
137-
138-
139-
140-
141-
#' @rdname as.Date.date_xx
142-
#' @export
143-
as_datetime.date_xx <- function(x, ...){
144-
assert_lubridate()
145-
lubridate::as_datetime(as.Date(x), ...)
146-
}
147-
148-
149131

150132

151133
#' @rdname as.Date.date_xx
@@ -162,5 +144,6 @@ as.POSIXlt.date_xx <- function(x, tz = "", ...){
162144
#' @inheritParams base::as.POSIXlt
163145
#' @export
164146
as.POSIXct.date_xx <- function(x, tz = "", ...){
165-
as.POSIXct(as.Date(x), tz = tz, ...)
147+
as.POSIXct(as.Date(x, tz = tz), tz = tz, ...)
148+
166149
}

R/dint-package.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55

66
.onLoad <- function(...) {
7-
dyn_register_s3_method("lubridate", "as_datetime", "date_xx")
8-
dyn_register_s3_method("lubridate", "as_date", "date_xx")
97
dyn_register_s3_method("lubridate", "year", "date_xx")
108
dyn_register_s3_method("lubridate", "month", "date_xx")
119
invisible()

0 commit comments

Comments
 (0)