I have an array of objects where each object has a date property.
When I try to filter this array based on date using spread sheet formula like this
[Date]=Date(2017,8,2)
This formula only works in the timezone +1:00. It does not work any other timezone. How can I make this formula work on any timezone?
I am using spread views library from Grapecity.
I could not find any way to set the timezone in the query for SpreadView either. In an answer to a similar query here, they mentioned that they do not support timezone in their controls either. You can, however, apply an intermediate solution. They seem to be considering the current browser's timezone when you are passing a date object like
Date(yyyy,mm,dd)
. So, if you can convert the dates into your data that you are receiving (or, the array of objects you have) in the browser's timezone, it would solve your problem in theory. You can convert yourDate
field in the the array of objects using moment.js as-This will convert your date values in the collection to the appropriate date according to the browser's timezone. After this pre-processing, your given query should work as expected.