summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorludovic <ludovic.pelle@gmail.com>2011-04-22 14:48:35 +0200
committerludovic <ludovic.pelle@gmail.com>2011-04-22 14:48:48 +0200
commite813364b5b73d574d89a7306ec372a5ea990b766 (patch)
treee83ef1c19b2810aeea6dea2a2afa6c6ce4b86a42
parenta59f9231c819f774b9d80e374130fcb463aa17c0 (diff)
downloadjquery-week-calendar-e813364b5b73d574d89a7306ec372a5ea990b766.zip
jquery-week-calendar-e813364b5b73d574d89a7306ec372a5ea990b766.tar.gz
jquery-week-calendar-e813364b5b73d574d89a7306ec372a5ea990b766.tar.bz2
fixed #49 + typo fix
-rw-r--r--jquery.weekcalendar.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/jquery.weekcalendar.js b/jquery.weekcalendar.js
index 0aa34c6..fb1d568 100644
--- a/jquery.weekcalendar.js
+++ b/jquery.weekcalendar.js
@@ -457,9 +457,9 @@
formatTime: function(date, format) {
if (format) {
return this._formatDate(date, format);
- } else if(this.options.timeFormat) {
+ } else if (this.options.timeFormat) {
return this._formatDate(date, this.options.timeFormat);
- } else if(this.options.use24Hour) {
+ } else if (this.options.use24Hour) {
return this._formatDate(date, 'H:i');
} else {
return this._formatDate(date, 'h:i a');
@@ -2008,7 +2008,9 @@
*/
_dateLastMilliOfWeek: function(date) {
var lastDayOfWeek = this._dateLastDayOfWeek(date);
- return new Date(lastDayOfWeek.getTime() + (MILLIS_IN_DAY));
+ lastDayOfWeek = this._cloneDate(lastDayOfWeek);
+ lastDayOfWeek.setDate(lastDayOfWeek.getDate() + 1);
+ return lastDayOfWeek;
},
@@ -2104,7 +2106,7 @@
m: function(date) { return (date.getMonth() < 9 ? '0' : '') + (date.getMonth() + 1); },
M: function(date, calendar) { return calendar.options.shortMonths[date.getMonth()]; },
n: function(date) { return date.getMonth() + 1; },
- t: function(date) { var d = date; return new Date(d.getFullYear(), d.getMonth()+1, 0).getDate() }, // Fixed now, gets #days of date
+ t: function(date) { var d = date; return new Date(d.getFullYear(), d.getMonth() + 1, 0).getDate() }, // Fixed now, gets #days of date
// Year
L: function(date) { var year = date.getFullYear(); return (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)); }, // Fixed now
o: function(date) { var d = new Date(date.valueOf()); d.setDate(d.getDate() - ((date.getDay() + 6) % 7) + 3); return d.getFullYear();}, //Fixed now