Spaces:
Build error
Build error
Commit ·
846dbe3
1
Parent(s): 4efd35b
minor bugfix
Browse files- __pycache__/helper.cpython-312.pyc +0 -0
- helper.py +2 -2
__pycache__/helper.cpython-312.pyc
CHANGED
|
Binary files a/__pycache__/helper.cpython-312.pyc and b/__pycache__/helper.cpython-312.pyc differ
|
|
|
helper.py
CHANGED
|
@@ -82,7 +82,7 @@ def parse_date(date_str):
|
|
| 82 |
date_str (str): The input date string.
|
| 83 |
|
| 84 |
Returns:
|
| 85 |
-
str: The date formatted as 'DD/MM/YYYY'.
|
| 86 |
"""
|
| 87 |
try:
|
| 88 |
return datetime.strptime(date_str, '%Y-%m-%d %H:%M:%S').strftime('%d/%m/%Y')
|
|
@@ -90,7 +90,7 @@ def parse_date(date_str):
|
|
| 90 |
try:
|
| 91 |
return datetime.strptime(date_str, '%m/%d/%Y').strftime('%d/%m/%Y')
|
| 92 |
except ValueError:
|
| 93 |
-
return date_str
|
| 94 |
|
| 95 |
def generate_df(master_data, df, employer_names):
|
| 96 |
"""
|
|
|
|
| 82 |
date_str (str): The input date string.
|
| 83 |
|
| 84 |
Returns:
|
| 85 |
+
str: The date formatted as 'DD/MM/YYYY', or the original string if parsing fails.
|
| 86 |
"""
|
| 87 |
try:
|
| 88 |
return datetime.strptime(date_str, '%Y-%m-%d %H:%M:%S').strftime('%d/%m/%Y')
|
|
|
|
| 90 |
try:
|
| 91 |
return datetime.strptime(date_str, '%m/%d/%Y').strftime('%d/%m/%Y')
|
| 92 |
except ValueError:
|
| 93 |
+
return date_str # Return original string if parsing fails
|
| 94 |
|
| 95 |
def generate_df(master_data, df, employer_names):
|
| 96 |
"""
|