Kanban Overdue info is displayed with 1 hour delay

Hi JMIX team,

We found that the overdue information is displayed with 1 hour difference.

Currently is 11:49 if the due date is set to 11:00 no delayed info is displayed in the kanban.

image

image

If we change to 10:00 the overdue information is displayed in the Kanban green rectangle.

image

image

We gave Javascript code (smart.kanban.js) to ChatGpt and we asked where the mistake is, the answer is listed below, in case this will help.

:red_circle: Where the problem is

The issue is in this comparison:

s.getTime() < (new Date).getTime()

At first glance it looks fine, but earlier in the code s is manually shifted for timezone:

s.setTime(
  s.getTime() - s.getTimezoneOffset() * 60 * 1000
);

So you end up comparing:

  • smanually timezone-adjusted
  • new Date()native local time

These two values are no longer in the same time reference.

:pushpin: Result: the comparison is off by exactly the timezone offset
(typically 1 hour in most European timezones).

:brain: Why the overdue warning appears 1 hour early/late

JavaScript already stores Date values internally in UTC and converts them to local time automatically.

By subtracting getTimezoneOffset() manually, the code effectively:

  • Converts the date into a “fake local UTC”
  • While new Date() remains true local time

This creates a fixed offset error, which is why the overdue flag only changes after one hour.

:no_entry_sign: The problematic line

This is the root cause:

s.setTime(s.getTime() - s.getTimezoneOffset() * 60 * 1000);

It breaks consistency in all later comparisons.

:white_check_mark: Correct solutions (choose one)

:white_check_mark: Option 1 — Remove manual timezone adjustment (recommended)

Simply remove the timezone correction:

// ❌ remove this
s.setTime(
  s.getTime() - s.getTimezoneOffset() * 60 * 1000
);

JavaScript will handle local time correctly by itself.

:heavy_check_mark: Cleanest solution
:heavy_check_mark: Prevents future bugs
:heavy_check_mark: Matches Smart UI internal behavior

:white_check_mark: Option 2 — Adjust now the same way

If you must keep the adjustment on s, then also adjust the current time:

const now = new Date();
now.setTime(
  now.getTime() - now.getTimezoneOffset() * 60 * 1000
);

const isOverdue =
  s.getTime() < now.getTime() &&
  a[t.progress] !== 100;

:pushpin: This keeps both values in the same timezone reference.

:brain: Final takeaway

The overdue warning is wrong because:

  • One date is manually timezone-shifted
  • The other (new Date()) is not
  • This causes a 1-hour offset bug

:point_right: Removing the manual timezone correction is the correct fix in most cases.

We could try these options but we are not sure how to overwrite this file. ¿Any hint?

Hi!

Thank you for your report.

Due to licensing restrictions, you cannot directly modify the smart.kanban.js file.

I’ve reproduced the bug and created an issue to fix it: Kanban overdue attribute is displayed with incorrect offset · Issue #4983 · jmix-framework/jmix · GitHub

The solution requires a comprehensive approach, because the property must also work correctly with offset time data types.

Best regards,
Dmitriy

Hi JMIX Team,

I saw that this bug was corrected with JMIX 2.7.4. I downloaded the new version but i still have the same problem,

image

It is something that i need to change from my end. I still have the same issue of 1 hour delayed, i am located in Madrid.(GMT+1)

As you can see in the photo due date is at 08:40 but current hour is 09:30.
image

No indication of delayed is displayed

image

If i change due date to 08:30 with current hour 09:32 then the exclamation circle in red is displayed.

image

As you can see in the screen

image

Regards

Hi!

It’s possible that the files required for the client-side have not been updated. Try running the vaadinClean Gradle task and restarting the project.

Regards,
Dmitriy

Hi Dmitriy

You are right, now it is working.

Thank you

1 Like