mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-10 23:48:01 -05:00
Fix datepicker DST bug (#2212)
* Fix datepicker DST bug. Closes #2204
This fix is borrowed from:
13885397de (diff-dd513a8bab7ad1033c8784c4a1b9ce15)
* Update NEWS.md
This commit is contained in:
2
NEWS.md
2
NEWS.md
@@ -47,6 +47,8 @@ This release features plot caching, an important new tool for improving performa
|
||||
|
||||
* Fixed [#2142](https://github.com/rstudio/shiny/issues/2142): Dropping files on `fileInput`s stopped working on recent releases of Firefox. Thanks @dmenne for reporting! [#2203](https://github.com/rstudio/shiny/pull/2203)
|
||||
|
||||
* Fixed [#2204](https://github.com/rstudio/shiny/issues/2204): `updateDateInput` could set the wrong date on days where DST begins. (Thanks @GaGaMan1101!) [#2212](https://github.com/rstudio/shiny/pull/2212)
|
||||
|
||||
### Documentation Updates
|
||||
|
||||
* Addressed [#1864](https://github.com/rstudio/shiny/issues/1864) by changing `optgroup` documentation to use `list` instead of `c`. ([#2084](https://github.com/rstudio/shiny/pull/2084))
|
||||
|
||||
@@ -529,7 +529,17 @@
|
||||
},
|
||||
|
||||
_utc_to_local: function(utc){
|
||||
return utc && new Date(utc.getTime() + (utc.getTimezoneOffset()*60000));
|
||||
|
||||
if (!utc) return utc;
|
||||
|
||||
var local = new Date(utc.getTime() + (utc.getTimezoneOffset() * 60000));
|
||||
|
||||
if (local.getTimezoneOffset() != utc.getTimezoneOffset())
|
||||
{
|
||||
local = new Date(utc.getTime() + (local.getTimezoneOffset() * 60000));
|
||||
}
|
||||
|
||||
return utc && local;
|
||||
},
|
||||
_local_to_utc: function(local){
|
||||
return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000));
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user