From 4b147004f379e7f62bba64b557c3df633ca1fa42 Mon Sep 17 00:00:00 2001 From: Chris Modzelewski Date: Wed, 12 Jul 2023 15:52:28 -0400 Subject: [PATCH 1/2] Fixed reference to datetime.timezone. --- highcharts_gantt/options/series/data/gantt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/highcharts_gantt/options/series/data/gantt.py b/highcharts_gantt/options/series/data/gantt.py index df93d1a..e15503c 100644 --- a/highcharts_gantt/options/series/data/gantt.py +++ b/highcharts_gantt/options/series/data/gantt.py @@ -1,6 +1,6 @@ from typing import Optional, List from decimal import Decimal -from datetime import datetime, date +from datetime import datetime, date, timezone from validator_collection import validators, checkers @@ -346,13 +346,13 @@ 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) + self.end = self.end.replace(tzinfo = 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) + self.start = self.start.replace(tzinfo = timezone.utc) untrimmed['start'] = self.start.timestamp() * 1000 else: From 8b2bbde1227416499be56d2a3df0ee46c4ffae65 Mon Sep 17 00:00:00 2001 From: Chris Modzelewski Date: Wed, 12 Jul 2023 15:52:38 -0400 Subject: [PATCH 2/2] Bumped version number and changelog. --- CHANGES.rst | 7 +++++++ highcharts_gantt/__version__.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 642d9d5..abec9ff 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,10 @@ +Release 1.2.3 +========================================= + +* **BUGFIX:** Fixed refernece bug in serialization of ``GanttData`` instances with timezone-naive ``datetime`` instances in ``start and ``end``. + +------------------ + Release 1.2.2 ========================================= diff --git a/highcharts_gantt/__version__.py b/highcharts_gantt/__version__.py index 923b987..5a5df3b 100644 --- a/highcharts_gantt/__version__.py +++ b/highcharts_gantt/__version__.py @@ -1 +1 @@ -__version__ = '1.2.2' +__version__ = '1.2.3'