BC,IC: Enable to get time int from float string (fix #21).

This commit is contained in:
Pierre-Antoine Rouby committed 2023-11-21 09:11:35 +01:00
1 parent 461202219d
commit 9b53b4302b
2 files changed
+8 -2

No files matched your search

@@ -188,8 +188,11 @@ class BoundaryCondition(SQLSubModel):
@classmethod
def time_convert(cls, data):
if type(data) is str and data.count(":") == 3:
if type(data) is str:
if data.count(":") == 3:
return old_pamhyr_date_to_timestamp(data)
if data.count(".") == 1:
return round(float(data))
return int(data)
@@ -188,8 +188,11 @@ class LateralContribution(SQLSubModel):
@classmethod
def time_convert(cls, data):
if data is str and data.count(":") == 3:
if type(data) is str:
if data.count(":") == 3:
return old_pamhyr_date_to_timestamp(data)
if data.count(".") == 1:
return round(float(data))
return int(data)