mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Support times specified as ISO strings too in date utils, not just datetimes.
This commit is contained in:
@@ -75,7 +75,10 @@ def datetime2ifc(dt, ifc_type):
|
||||
if isinstance(dt, str):
|
||||
if ifc_type == "IfcDuration":
|
||||
return dt
|
||||
dt = datetime.datetime.fromisoformat(dt)
|
||||
try:
|
||||
dt = datetime.datetime.fromisoformat(dt)
|
||||
except:
|
||||
dt = datetime.time.fromisoformat(dt)
|
||||
|
||||
if ifc_type == "IfcDuration":
|
||||
return isodate.duration_isoformat(dt)
|
||||
|
||||
Reference in New Issue
Block a user