I’ve encountered very annoying problems when trying to filter DateTime column for entities in a specified day. The only way I came up with was using custom filter and dateEquals, but neither macro, nor the component respect user’s timezone. Scenario:
DB + JAVA Server in UTC
User is in GMT+1
Filter field with java.sql.Date as paramClass
Instead of filtering between 00:00 and 23:59 of users timezone, it filters the same range in server’s timezone - user gets results between 1:00 and 00:59 of the next day
We needed to fix it by overriding com.haulmont.cuba.gui.components.filter.Param and com.haulmont.cuba.core.sys.querymacro.DateEqualsMacroHandler. Cuba handles user’s TimeZone in other place well, this is a real shame!
Fair enough. We sadly do not have time to go through other truncating macros and as this was irritating our customer we had to deal with it somehow. I hope the PR have helped you a bit.
Sure, it clearly defines the problem and a possible solution. But I have no idea at the moment how to save other use cases with date parameter from breaking.
I click on the link to the similar issue you refer to in post #4 but YouTrack does not seem to find it, is there a back-up or some documentation on it?
Thanks again
The link to the issue is broken now, we’ll fix it soon. Thanks for pointing this out.
But looks like the issue was fixed for CUBA v.6.8.0.
What version are you using?