Highlighted

Date Generated glitch in Footer?

super1236

29-01-2019

Today I ran across an issue where the date generated on the last page of the report was one day in the future,even though the report was run at 8:30 this morning.

Here is the code that is present in the master pages:

// Current Date in short-style date format.

$.rawValue = num2date(date(), DateFmt(1))

I ran the same report about an hour ago and all the dates were fine, today's date. Has anyone seen this before?

Replies

Highlighted

Gaurav-Behl

MVP

29-01-2019

This code seems to be written using jQuery. The client-side library code would always run in the browser and would be impacted by timezones as you are generating date on client-side and not on server-side (specifically if you work on VPN/Cloud).

$.rawValue = num2date(date(), DateFmt(1))

Probably, this could be the reason for this behavior.

Highlighted

super1236

29-01-2019

Thank you, but why it would only be on one page and not all pages? We also just figured out that if we restart the browser the problem is solved. Dates appear as expected.

Highlighted

Gaurav-Behl

MVP

29-01-2019

If it doesn't work for one page then I assume the design of that page/component could be the root cause. How is that component setup?

If you restart the browser and it gets fixed, then most likely it uses either non-persistent/session based cookie or token or sessionStorage which gets wiped out as soon as the browser is closed.

I'm sure when you go through that component/s design, you'll definitely find more clues.

Highlighted

super1236

04-02-2019

I have a solution to my problem.

First, don't use FormCalc. FormCalc running the code I was using leads to the inconsistent timestamps in the future.

Switching to Javascript and leveraging custom code to generate the timestamp resolved our problem.