From 1ce9236e82f937cccdfcb74bac1d467a709e5f0c Mon Sep 17 00:00:00 2001 From: Chris Modzelewski Date: Thu, 6 Jul 2023 21:22:16 -0400 Subject: [PATCH 1/3] Fixed serialization of timezone-naive timestamps in GanttData. Closes #29. --- highcharts_gantt/options/series/data/gantt.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/highcharts_gantt/options/series/data/gantt.py b/highcharts_gantt/options/series/data/gantt.py index 5bae022..df93d1a 100644 --- a/highcharts_gantt/options/series/data/gantt.py +++ b/highcharts_gantt/options/series/data/gantt.py @@ -345,10 +345,15 @@ def _to_untrimmed_dict(self, in_cls = None) -> dict: } if self.end is not None and hasattr(self.end, 'timestamp'): + if not self.end.tzinfo: + self.end = self.end.replace(tzinfo = datetime.timezone.utc) untrimmed['end'] = self.end.timestamp() * 1000 else: untrimmed['end'] = self.end if self.start is not None and hasattr(self.start, 'timestamp'): + if not self.start.tzinfo: + self.start = self.start.replace(tzinfo = datetime.timezone.utc) + untrimmed['start'] = self.start.timestamp() * 1000 else: untrimmed['start'] = self.start From eb0591b2926f3c79cd2468105b2d6b8bc51eeccf Mon Sep 17 00:00:00 2001 From: Chris Modzelewski Date: Thu, 6 Jul 2023 21:22:30 -0400 Subject: [PATCH 2/3] Fixed mis-linked documentation. --- docs/api/options/series/gantt.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/api/options/series/gantt.rst b/docs/api/options/series/gantt.rst index cb026bc..d2c33d9 100644 --- a/docs/api/options/series/gantt.rst +++ b/docs/api/options/series/gantt.rst @@ -1,5 +1,5 @@ ########################################################################################## -:mod:`.gantt ` +:mod:`.gantt ` ########################################################################################## .. contents:: Module Contents @@ -9,10 +9,10 @@ -------------- -.. module:: highcharts_core.options.series.gantt +.. module:: highcharts_gantt.options.series.gantt ******************************************************************************************************************** -class: :class:`GanttSeries ` +class: :class:`GanttSeries ` ******************************************************************************************************************** .. autoclass:: GanttSeries @@ -22,7 +22,7 @@ class: :class:`GanttSeries ` .. collapse:: Class Inheritance .. inheritance-diagram:: GanttSeries - :top-classes: highcharts_core.metaclasses.HighchartsMeta + :top-classes: highcharts_gantt.metaclasses.HighchartsMeta, highcharts_core.metaclasses.HighchartsMeta :parts: -1 | From 5f39651fdee15a4ec226fa0c89f7d7834574b4ad Mon Sep 17 00:00:00 2001 From: Chris Modzelewski Date: Thu, 6 Jul 2023 21:23:03 -0400 Subject: [PATCH 3/3] Bumped version number and updated changelog. --- CHANGES.rst | 8 ++++++++ highcharts_gantt/__version__.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 9a937e1..642d9d5 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,11 @@ +Release 1.2.2 +========================================= + +* **BUGFIX:** Fixed support for serialization of ``GanttData`` instances with timezone-naive ``datetime`` instances in ``start and ``end``. Closes #29. +* **DOCS:** Fixed broken links in documentation to ``options.series.gantt.GanttSeries`` and ``options.series.data.gantt.GanttData``. Closes #28. + +------------------ + Release 1.2.1 ========================================= diff --git a/highcharts_gantt/__version__.py b/highcharts_gantt/__version__.py index 3f262a6..923b987 100644 --- a/highcharts_gantt/__version__.py +++ b/highcharts_gantt/__version__.py @@ -1 +1 @@ -__version__ = '1.2.1' +__version__ = '1.2.2'