We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75171c2 commit fec61faCopy full SHA for fec61fa
highcharts_core/metaclasses.py
@@ -348,7 +348,12 @@ def trim_dict(untrimmed: dict,
348
as_dict[key] = trimmed_value
349
# Date or Time
350
elif checkers.is_date(value) or checkers.is_time(value):
351
- if to_json:
+ if to_json and checkers.is_date(value):
352
+ trimmed_value = validators.datetime(value)
353
+ if not trimmed_value.tzinfo:
354
+ trimmed_value = trimmed_value.replace(tzinfo=datetime.timezone.utc)
355
+ as_dict[key] = trimmed_value.timestamp() * 1000
356
+ elif to_json:
357
as_dict[key] = value.isoformat()
358
else:
359
as_dict[key] = value
0 commit comments