Skip to content
8 changes: 8 additions & 0 deletions R/scale-date.R
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ ScaleContinuousDatetime <- ggproto("ScaleContinuousDatetime", ScaleContinuous,
i = "The value was converted to {obj_type_friendly(x)}."
), call = self$call)
}
if (inherits(x, "Date")) {
cli::cli_abort("You supplied a {.cls {class(x)}} field.
Did you mean to use {.fn scale_*_date}?", call = self$call)
}
ggproto_parent(ScaleContinuous, self)$transform(x)
},
map = function(self, x, limits = self$get_limits()) {
Expand Down Expand Up @@ -416,6 +420,10 @@ ScaleContinuousDate <- ggproto("ScaleContinuousDate", ScaleContinuous,
i = "The value was converted to {obj_type_friendly(x)}."
), call = self$call)
}
if (inherits(x, "POSIXct")) {
cli::cli_abort("You supplied a {.cls {class(x)}} field.
Did you mean to use {.fn scale_*_datetime}?", call = self$call)
}
ggproto_parent(ScaleContinuous, self)$transform(x)
},
get_breaks = function(self, limits = self$get_limits()) {
Expand Down