add reverse function
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
# import qdate
|
# import qdate
|
||||||
from PyQt6 import QtCore
|
from PyQt6 import QtCore
|
||||||
|
from .debug import debugMessage
|
||||||
|
|
||||||
def stringToDate(date: str) -> QtCore.QDate:
|
def stringToDate(date: str) -> QtCore.QDate:
|
||||||
"""Takes an input string and returns a QDate object.
|
"""Takes an input string and returns a QDate object.
|
||||||
|
|
||||||
@@ -11,7 +10,17 @@ def stringToDate(date: str) -> QtCore.QDate:
|
|||||||
Returns:
|
Returns:
|
||||||
QtCore.QDate: the QDate object in string format DD.MM.yyyy
|
QtCore.QDate: the QDate object in string format DD.MM.yyyy
|
||||||
"""
|
"""
|
||||||
|
debugMessage(date=date)
|
||||||
|
if not date:
|
||||||
|
return ""
|
||||||
|
if "." in date:
|
||||||
|
# converts the date from dd.mm.yyyy to qdate
|
||||||
|
datedata = date.split(".")
|
||||||
|
day = datedata[0]
|
||||||
|
month = datedata[1]
|
||||||
|
year = datedata[2]
|
||||||
|
return QtCore.QDate(int(year), int(month), int(day)) # .toString("dd.MM.yyyy")
|
||||||
|
else:
|
||||||
datedata = date.split(" ")[1:]
|
datedata = date.split(" ")[1:]
|
||||||
month = datedata[0]
|
month = datedata[0]
|
||||||
day = datedata[1]
|
day = datedata[1]
|
||||||
|
|||||||
Reference in New Issue
Block a user