mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-09 22:25:59 -05:00
23
tools/datepicker-patches/000-fix-datepicker-dst-bug.patch
Normal file
23
tools/datepicker-patches/000-fix-datepicker-dst-bug.patch
Normal file
@@ -0,0 +1,23 @@
|
||||
diff --git a/inst/www/shared/datepicker/js/bootstrap-datepicker.js b/inst/www/shared/datepicker/js/bootstrap-datepicker.js
|
||||
index 76a99fc2..97f5c086 100644
|
||||
--- a/inst/www/shared/datepicker/js/bootstrap-datepicker.js
|
||||
+++ b/inst/www/shared/datepicker/js/bootstrap-datepicker.js
|
||||
@@ -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));
|
||||
Reference in New Issue
Block a user