dately 2.0.6__tar.gz → 2.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dately-2.0.6 → dately-2.1.0}/PKG-INFO +1 -1
- {dately-2.0.6 → dately-2.1.0}/dately/timeutils.py +8 -3
- {dately-2.0.6 → dately-2.1.0}/dately.egg-info/PKG-INFO +1 -1
- {dately-2.0.6 → dately-2.1.0}/setup.py +1 -1
- {dately-2.0.6 → dately-2.1.0}/README.md +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/__init__.py +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/core.py +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/mold/__init__.py +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/Compiled.cp38-win_amd64.pyd +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/__init__.py +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/cdatetime/UniversalDateFormatter.cp38-win_amd64.pyd +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/cdatetime/__init__.py +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/cdatetime/iso8601T.cp38-win_amd64.pyd +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/cdatetime/iso8601Z.cp38-win_amd64.pyd +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/cdatetime/whichformat.cp38-win_amd64.pyd +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/clean_str.cp38-win_amd64.pyd +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/time_zones.cp38-win_amd64.pyd +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/mskutils.py +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/sysutils.py +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/timezone.py +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately/utils.py +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately.egg-info/SOURCES.txt +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately.egg-info/dependency_links.txt +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately.egg-info/requires.txt +0 -0
- {dately-2.0.6 → dately-2.1.0}/dately.egg-info/top_level.txt +0 -0
- {dately-2.0.6 → dately-2.1.0}/setup.cfg +0 -0
|
@@ -328,8 +328,7 @@ def extract_time_fragment(date_time_string, locale=False):
|
|
|
328
328
|
else:
|
|
329
329
|
return match.group(0), None, None
|
|
330
330
|
return None, None, None
|
|
331
|
-
|
|
332
|
-
|
|
331
|
+
|
|
333
332
|
def replace_time_by_position(datetime_string, component, new_value):
|
|
334
333
|
"""
|
|
335
334
|
Modifies a specified component of a time within a datetime string based on provided patterns.
|
|
@@ -354,8 +353,14 @@ def replace_time_by_position(datetime_string, component, new_value):
|
|
|
354
353
|
or if the microsecond value is not a digit.
|
|
355
354
|
"""
|
|
356
355
|
# Validate and adjust the new value based on the component
|
|
356
|
+
## if component == 'hour':
|
|
357
|
+
## new_value = str(max(0, min(23, int(new_value))))
|
|
357
358
|
if component == 'hour':
|
|
358
|
-
|
|
359
|
+
# Check if the input is a string and starts with a '0'
|
|
360
|
+
if isinstance(new_value, str) and new_value.startswith("0") and len(new_value) == 2 and int(new_value) < 10:
|
|
361
|
+
new_value = "0" + str(max(0, min(23, int(new_value))))
|
|
362
|
+
else:
|
|
363
|
+
new_value = str(max(0, min(23, int(new_value))))
|
|
359
364
|
elif component in ['minute', 'second']:
|
|
360
365
|
new_value = str(max(0, min(59, int(new_value)))).zfill(2)
|
|
361
366
|
elif component == 'microsecond':
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/cdatetime/UniversalDateFormatter.cp38-win_amd64.pyd
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|