From 8da7c166c8088989afe0f46ad7990f5b078ca5aa Mon Sep 17 00:00:00 2001 From: carmazine Date: Fri, 12 Jun 2020 22:46:09 +0200 Subject: [PATCH] Parameterize utcOffset during construction Allows for control over timezone offset in a simple, optional manner --- pyqtgraph/graphicsItems/DateAxisItem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/graphicsItems/DateAxisItem.py b/pyqtgraph/graphicsItems/DateAxisItem.py index a5132fd9..846abb90 100644 --- a/pyqtgraph/graphicsItems/DateAxisItem.py +++ b/pyqtgraph/graphicsItems/DateAxisItem.py @@ -200,7 +200,7 @@ class DateAxisItem(AxisItem): """ - def __init__(self, orientation='bottom', **kwargs): + def __init__(self, orientation='bottom', utcOffset=time.timezone, **kwargs): """ Create a new DateAxisItem. @@ -211,7 +211,7 @@ class DateAxisItem(AxisItem): super(DateAxisItem, self).__init__(orientation, **kwargs) # Set the zoom level to use depending on the time density on the axis - self.utcOffset = time.timezone + self.utcOffset = utcOffset self.zoomLevels = OrderedDict([ (np.inf, YEAR_MONTH_ZOOM_LEVEL),