Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: now() function timezone offset #3040

Merged
merged 13 commits into from
Oct 4, 2023
Merged

Conversation

SteRiccio
Copy link
Member

fixes #3035

@SteRiccio SteRiccio self-assigned this Sep 29, 2023
@ramirobg94
Copy link
Contributor

Are there any way to solve this without use the timezone? I mean using the iso date with the timezone.

@SteRiccio
Copy link
Member Author

Are there any way to solve this without use the timezone? I mean using the iso date with the timezone.

I think that the easiest thing to solve this without passing the timezone or the timezone offset to the server is to store the time as a Date in ISO format, then format it in the client using its timezone... is this what you mean?

@SteRiccio SteRiccio marked this pull request as draft September 29, 2023 20:06
@ramirobg94
Copy link
Contributor

yes, use the iso data all the time

@SteRiccio
Copy link
Member Author

yes, use the iso data all the time

I've just tried, the problem is that this approch introduces other pains elsewhere, e.g. in expressions that compare date or time attributes... even in that case you will have to pass the client timezone. a this point it's better to keep the storage format as it is and calculate the offset when the value is stored.

@ramirobg94
Copy link
Contributor

Where are the expressions evaluated? at the same timezone of the user (client side)?

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@SteRiccio
Copy link
Member Author

Where are the expressions evaluated? at the same timezone of the user (client side)?

for the expressions validation client side, otherwise server side

@SteRiccio
Copy link
Member Author

Where are the expressions evaluated? at the same timezone of the user (client side)?

they are evaluated in NodeDefValidator, at the same timezone of the client, but the record updater runs server side, ignoring the client timezone

@SteRiccio SteRiccio marked this pull request as ready for review October 3, 2023 08:39
@mergify mergify bot merged commit de2ccd6 into master Oct 4, 2023
@mergify mergify bot deleted the fix/now-function-timezone-offset branch October 4, 2023 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

now() : it gives the time of the server! adjust it with user timezone
2 participants