summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony <quietbutstrong@gmail.com>2012-10-16 17:06:45 -0300
committerAnthony <quietbutstrong@gmail.com>2012-10-16 17:06:45 -0300
commitde31c6ea22ed5b77178f6ac5d3a6d7f3289b6f71 (patch)
tree0b9715f7e2b50b9e99ef7e54a2b6430a86a9cbf9
parent2e4fae3cc97962cb3b618082fc7e3e00dc99bc53 (diff)
downloadjquery-week-calendar-de31c6ea22ed5b77178f6ac5d3a6d7f3289b6f71.zip
jquery-week-calendar-de31c6ea22ed5b77178f6ac5d3a6d7f3289b6f71.tar.gz
jquery-week-calendar-de31c6ea22ed5b77178f6ac5d3a6d7f3289b6f71.tar.bz2
account for EST/EDT in _updateDayColumnHeader
inĀ _updateDayColumnHeader, if one day started as EST and ended as EDT, one endDate in $weekDayColumns would not have the correct timezone.
-rw-r--r--jquery.weekcalendar.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/jquery.weekcalendar.js b/jquery.weekcalendar.js
index 011820c..0bc2af9 100644
--- a/jquery.weekcalendar.js
+++ b/jquery.weekcalendar.js
@@ -1322,6 +1322,14 @@
$weekDayColumns.each(function(i, val) {
$(this).data('startDate', self._cloneDate(currentDay));
+
+ var endDate = self._cloneDate(currentDay);
+ endDate.setTime(currentDay.getTime() + MILLIS_IN_DAY);
+
+ if(endDate.getTimezoneOffset() != currentDay.getTimezoneOffset()) {
+ endDate.setTime(endDate.getTime()+(endDate.getTimezoneOffset()-currentDay.getTimezoneOffset())*60000);
+ }
+
$(this).data('endDate', new Date(currentDay.getTime() + (MILLIS_IN_DAY)));
if (self._isToday(currentDay)) {
$(this).parent()