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

setup.py
Pierre-Antoine Rouby 2023-11-21 09:10:11 +01:00
parent 461202219d
commit 9b53b4302b
2 changed files with 10 additions and 4 deletions

View File

@ -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)

View File

@ -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)