Skip to content

Commit

Permalink
Merge pull request #156 from vieira/patch-1
Browse files Browse the repository at this point in the history
Fixes "today" display caused by faulty rounding
  • Loading branch information
usmonster committed Oct 19, 2014
2 parents fdbb279 + 345672d commit 3a0028d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions js/jquery.fn.gantt.js
Original file line number Diff line number Diff line change
Expand Up @@ -968,18 +968,15 @@
// Remove the `wd` (weekday) class and add `today` class to the
// current day/week/month (depending on the current scale)
markNow: function (element) {
var cd = new Date().setHours(0, 0, 0, 0);
switch (settings.scale) {
case "weeks":
var cd = Date.parse(new Date());
cd = (Math.floor(cd / 36400000) * 36400000);
$(element).find(':findweek("' + cd + '")').removeClass('wd').addClass('today');
break;
case "months":
$(element).find(':findmonth("' + new Date().getTime() + '")').removeClass('wd').addClass('today');
break;
default:
var cd = Date.parse(new Date());
cd = (Math.floor(cd / 36400000) * 36400000);
$(element).find(':findday("' + cd + '")').removeClass('wd').addClass('today');
break;
}
Expand Down

0 comments on commit 3a0028d

Please sign in to comment.