Commit 9b53b430 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

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

Showing with 10 additions and 4 deletions
+10 -4
...@@ -188,8 +188,11 @@ class BoundaryCondition(SQLSubModel): ...@@ -188,8 +188,11 @@ class BoundaryCondition(SQLSubModel):
@classmethod @classmethod
def time_convert(cls, data): def time_convert(cls, data):
if type(data) is str and data.count(":") == 3: if type(data) is str:
return old_pamhyr_date_to_timestamp(data) if data.count(":") == 3:
return old_pamhyr_date_to_timestamp(data)
if data.count(".") == 1:
return round(float(data))
return int(data) return int(data)
......
...@@ -188,8 +188,11 @@ class LateralContribution(SQLSubModel): ...@@ -188,8 +188,11 @@ class LateralContribution(SQLSubModel):
@classmethod @classmethod
def time_convert(cls, data): def time_convert(cls, data):
if data is str and data.count(":") == 3: if type(data) is str:
return old_pamhyr_date_to_timestamp(data) if data.count(":") == 3:
return old_pamhyr_date_to_timestamp(data)
if data.count(".") == 1:
return round(float(data))
return int(data) return int(data)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment