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

LC: Add DMY datetime support.

No related merge requests found
Pipeline #54768 passed with stages
in 3 minutes and 20 seconds
Showing with 10 additions and 1 deletion
+10 -1
...@@ -18,7 +18,12 @@ ...@@ -18,7 +18,12 @@
import logging import logging
from tools import trace, timer, old_pamhyr_date_to_timestamp from tools import (
trace, timer,
old_pamhyr_date_to_timestamp,
date_iso_to_timestamp,
date_dmy_to_timestamp,
)
from Model.Tools.PamhyrDB import SQLSubModel from Model.Tools.PamhyrDB import SQLSubModel
from Model.Except import NotImplementedMethodeError from Model.Except import NotImplementedMethodeError
...@@ -189,6 +194,10 @@ class LateralContribution(SQLSubModel): ...@@ -189,6 +194,10 @@ class LateralContribution(SQLSubModel):
@classmethod @classmethod
def time_convert(cls, data): def time_convert(cls, data):
if type(data) is str: if type(data) is str:
if data.count("-") == 2:
return date_iso_to_timestamp(data)
if data.count("/") == 2:
return date_dmy_to_timestamp(data)
if data.count(":") == 3: if data.count(":") == 3:
return old_pamhyr_date_to_timestamp(data) return old_pamhyr_date_to_timestamp(data)
if data.count(":") == 2: if data.count(":") == 2:
......
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