Skip to content

Commit

Permalink
Merge pull request #31 from highcharts-for-python/develop
Browse files Browse the repository at this point in the history
PR for v.1.2.3
  • Loading branch information
hcpchris authored Jul 12, 2023
2 parents c644e88 + 5516ad3 commit a424af7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -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
=========================================

Expand Down
2 changes: 1 addition & 1 deletion highcharts_gantt/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.2.2'
__version__ = '1.2.3'
6 changes: 3 additions & 3 deletions highcharts_gantt/options/series/data/gantt.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit a424af7

Please sign in to comment.