Skip to content

Commit

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

Expand Down
8 changes: 4 additions & 4 deletions docs/api/options/series/gantt.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##########################################################################################
:mod:`.gantt <highcharts_core.options.series.gantt>`
:mod:`.gantt <highcharts_gantt.options.series.gantt>`
##########################################################################################

.. contents:: Module Contents
Expand All @@ -9,10 +9,10 @@

--------------

.. module:: highcharts_core.options.series.gantt
.. module:: highcharts_gantt.options.series.gantt

********************************************************************************************************************
class: :class:`GanttSeries <highcharts_core.options.series.gantt.GanttSeries>`
class: :class:`GanttSeries <highcharts_gantt.options.series.gantt.GanttSeries>`
********************************************************************************************************************

.. autoclass:: GanttSeries
Expand All @@ -22,7 +22,7 @@ class: :class:`GanttSeries <highcharts_core.options.series.gantt.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

|
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.1'
__version__ = '1.2.2'
5 changes: 5 additions & 0 deletions highcharts_gantt/options/series/data/gantt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c644e88

Please sign in to comment.