craft-commerce-widgets icon indicating copy to clipboard operation
craft-commerce-widgets copied to clipboard

Widget timezone reporting

Open moacode opened this issue 6 years ago • 1 comments

Hi there, would it be possible to take into account Craft's timezone setting when fetching data for the various widgets?

I recently took the plunge and built a custom widget that reported on different order types (specific to a particular CC site). I found that all dates are stored in UTC time, so to get the correct output for my timezone (Pacific/Auckland), I needed to do something similar to a fix implemented in CC earlier in the year: https://github.com/craftcms/commerce/commit/b36ad11ea21d1914edefa33003453301ea30f4c3.

Just for reference, this is what I'm currently seeing with the goal widget vs. Craft Commerce:

Screen Shot 2019-10-15 at 9 05 34 AM

Screen Shot 2019-10-15 at 9 05 26 AM

... and this is from my custom widget:

Screen Shot 2019-10-15 at 9 05 41 AM

If I get time I might have a crack and raise a PR, but can't promise anything!

moacode avatar Oct 14 '19 20:10 moacode

Definitely! I do have timezones on the roadmap for this, but it wasn't a priority, but I can bump it up.

If you fancy doing a PR though, go ahead, as it will be a few weeks until I can look at adding this in. If you do a PR I'll chuck you a free license 💯

bymayo avatar Oct 15 '19 07:10 bymayo