mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
BC,IC: Enable to get time int from float string (fix #21).
This commit is contained in:
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)
|
||||
|
||||
|
||||
Reference in new issue
Block a user