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.
Files changed (26) hide show
  1. {dately-2.0.6 → dately-2.1.0}/PKG-INFO +1 -1
  2. {dately-2.0.6 → dately-2.1.0}/dately/timeutils.py +8 -3
  3. {dately-2.0.6 → dately-2.1.0}/dately.egg-info/PKG-INFO +1 -1
  4. {dately-2.0.6 → dately-2.1.0}/setup.py +1 -1
  5. {dately-2.0.6 → dately-2.1.0}/README.md +0 -0
  6. {dately-2.0.6 → dately-2.1.0}/dately/__init__.py +0 -0
  7. {dately-2.0.6 → dately-2.1.0}/dately/core.py +0 -0
  8. {dately-2.0.6 → dately-2.1.0}/dately/mold/__init__.py +0 -0
  9. {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/Compiled.cp38-win_amd64.pyd +0 -0
  10. {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/__init__.py +0 -0
  11. {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/cdatetime/UniversalDateFormatter.cp38-win_amd64.pyd +0 -0
  12. {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/cdatetime/__init__.py +0 -0
  13. {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/cdatetime/iso8601T.cp38-win_amd64.pyd +0 -0
  14. {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/cdatetime/iso8601Z.cp38-win_amd64.pyd +0 -0
  15. {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/cdatetime/whichformat.cp38-win_amd64.pyd +0 -0
  16. {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/clean_str.cp38-win_amd64.pyd +0 -0
  17. {dately-2.0.6 → dately-2.1.0}/dately/mold/pyd/time_zones.cp38-win_amd64.pyd +0 -0
  18. {dately-2.0.6 → dately-2.1.0}/dately/mskutils.py +0 -0
  19. {dately-2.0.6 → dately-2.1.0}/dately/sysutils.py +0 -0
  20. {dately-2.0.6 → dately-2.1.0}/dately/timezone.py +0 -0
  21. {dately-2.0.6 → dately-2.1.0}/dately/utils.py +0 -0
  22. {dately-2.0.6 → dately-2.1.0}/dately.egg-info/SOURCES.txt +0 -0
  23. {dately-2.0.6 → dately-2.1.0}/dately.egg-info/dependency_links.txt +0 -0
  24. {dately-2.0.6 → dately-2.1.0}/dately.egg-info/requires.txt +0 -0
  25. {dately-2.0.6 → dately-2.1.0}/dately.egg-info/top_level.txt +0 -0
  26. {dately-2.0.6 → dately-2.1.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dately
3
- Version: 2.0.6
3
+ Version: 2.1.0
4
4
  Summary: A library for manipulating datetime strings.
5
5
  Home-page: https://github.com/cedricmoorejr/dately
6
6
  Author: Cedric Moore Jr.
@@ -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
- new_value = str(max(0, min(23, int(new_value))))
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':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dately
3
- Version: 2.0.6
3
+ Version: 2.1.0
4
4
  Summary: A library for manipulating datetime strings.
5
5
  Home-page: https://github.com/cedricmoorejr/dately
6
6
  Author: Cedric Moore Jr.
@@ -8,7 +8,7 @@ if sys.platform != 'win32':
8
8
 
9
9
  setup(
10
10
  name="dately",
11
- version="2.0.6",
11
+ version="2.1.0",
12
12
  author="Cedric Moore Jr.",
13
13
  author_email="cedric@doydl.tech",
14
14
  description="A library for manipulating datetime strings.",
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