mirror of https://gitlab.com/pamhyr/pamhyr2
BC,IC: Enable to get time int from float string (fix #21).
parent
461202219d
commit
9b53b4302b
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue