Skip to content

Commit 3a0028d

Browse files
committed
Merge pull request #156 from vieira/patch-1
Fixes "today" display caused by faulty rounding
2 parents fdbb279 + 345672d commit 3a0028d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

js/jquery.fn.gantt.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -968,18 +968,15 @@
968968
// Remove the `wd` (weekday) class and add `today` class to the
969969
// current day/week/month (depending on the current scale)
970970
markNow: function (element) {
971+
var cd = new Date().setHours(0, 0, 0, 0);
971972
switch (settings.scale) {
972973
case "weeks":
973-
var cd = Date.parse(new Date());
974-
cd = (Math.floor(cd / 36400000) * 36400000);
975974
$(element).find(':findweek("' + cd + '")').removeClass('wd').addClass('today');
976975
break;
977976
case "months":
978977
$(element).find(':findmonth("' + new Date().getTime() + '")').removeClass('wd').addClass('today');
979978
break;
980979
default:
981-
var cd = Date.parse(new Date());
982-
cd = (Math.floor(cd / 36400000) * 36400000);
983980
$(element).find(':findday("' + cd + '")').removeClass('wd').addClass('today');
984981
break;
985982
}

0 commit comments

Comments
 (0)