Skip to content

Commit 467990b

Browse files
committed
separate labelling logic
1 parent c2d9409 commit 467990b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

R/scale-date.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,13 @@ datetime_scale <- function(aesthetics, transform, trans = deprecated(),
328328
}
329329
if (!is.waiver(date_labels)) {
330330
check_string(date_labels)
331-
labels <- function(self, x) {
332-
tz <- self$timezone %||% "UTC"
333-
label_date(date_labels, tz)(x)
331+
if (transform == "hms") {
332+
labels <- label_time(date_labels)
333+
} else {
334+
labels <- function(self, x) {
335+
tz <- self$timezone %||% "UTC"
336+
label_date(date_labels, tz)(x)
337+
}
334338
}
335339
}
336340

0 commit comments

Comments
 (0)