Skip to content

Commit ff31715

Browse files
authored
Construct time_trans with the given timezone (#4429)
1 parent 65662cf commit ff31715

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# ggplot2 (development version)
22

3+
* Fix bug in `scale_[x|y]_datetime()` where a specified timezone would be
4+
ignored by the scale (@thomasp85, #4007)
5+
36
* Using `theme(aspect.ratio = ...)` together with free space in `facet_grid()`
47
now crrectly throws an error (@thomasp85, #3834)
58

R/scale-date.r

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,11 @@ datetime_scale <- function(aesthetics, trans, palette,
314314
scale_class <- ScaleContinuous
315315
}
316316

317+
trans <- switch(trans,
318+
date = date_trans(),
319+
time = time_trans(timezone)
320+
)
321+
317322
sc <- continuous_scale(
318323
aesthetics,
319324
name,

0 commit comments

Comments
 (0)