Skip to content

Commit

Permalink
Support for pandas TimeStamp
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred Lefévère-Laoide authored and Fred Lefévère-Laoide committed Jun 14, 2024
1 parent 94503b8 commit ac685fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions taipy/gui/utils/date.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def _date_to_string(date_val: t.Union[datetime, date, time]) -> str:
if isinstance(date_val, datetime):
# return date.isoformat() + 'Z', if possible
try:
if date_val.tzinfo is None:
return date_val.isoformat()
return date_val.astimezone(utc).isoformat()
except Exception as e:
# astimezone() fails on Windows for pre-epoch times
Expand Down
4 changes: 1 addition & 3 deletions taipy/gui_core/_adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,8 @@ def __get_data(self, dn: DataNode):
return (None, None, True, None)
val_type = (
"date"
if "date" in type(value).__name__
if "date" in type(value).__name__.lower() or "timestamp" in type(value).__name__.lower()
else type(value).__name__
if isinstance(value, Number)
else None
)
if isinstance(value, float) and math.isnan(value):
value = None
Expand Down

0 comments on commit ac685fc

Please sign in to comment.