Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
When a custom date range is requested, the timezone of the requested website may be ignored #5356
There is bug in Archive::build() method.
In (1) timezone is being only passed to Period factory (2) when it's not range (so day,week,month,year, single date). If we take date range (startDate,endDate), period = range, or use lastN/previousN the timezone is not being passed to factory.
When reporting a bug, it would be super helpful if you also report the steps you used to reproduce this issue in an isolated way.
Steps to reproduce are important to help trouble shoot the issue, but also we need steps to know how to write a test case (since test case usually closely matches steps to reproduce).
I tried to reproduce the issue as follows:
I've re-thinked this issue and I think I've found way to reproduce issue. Here are steps to this:
For convienience you can use this quick plugin with API method to peek into timezones:
As for reproducing in isolated test case - I think steps should be quite the same.
This test should cover all cases, in which Period::factory will be using Range class, so it would be period=range, lastX, previousX, or date spans like 2014-06-19,2014-06-20 (possibly there will be more cases ?).
Just to clarfy - actual problem is with time-shift between proper midnights in different timezones, can cause for ex. situation when it's 2014-06-20 before midnight of New York time (while it's after midnight in UTC) , user querying for date = 2014-06-18,today will recieve data including 2014-05-20 .. which hasn't actually started in timezone of site.
Hope this makes this issue reproduceable and easier to solve.