none-shall-parse 0.6.1__tar.gz → 0.6.2__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.
- {none_shall_parse-0.6.1 → none_shall_parse-0.6.2}/PKG-INFO +1 -1
- {none_shall_parse-0.6.1 → none_shall_parse-0.6.2}/pyproject.toml +1 -1
- {none_shall_parse-0.6.1 → none_shall_parse-0.6.2}/src/none_shall_parse/dates.py +15 -3
- {none_shall_parse-0.6.1 → none_shall_parse-0.6.2}/README.md +0 -0
- {none_shall_parse-0.6.1 → none_shall_parse-0.6.2}/src/none_shall_parse/__init__.py +0 -0
- {none_shall_parse-0.6.1 → none_shall_parse-0.6.2}/src/none_shall_parse/imeis.py +0 -0
- {none_shall_parse-0.6.1 → none_shall_parse-0.6.2}/src/none_shall_parse/lists.py +0 -0
- {none_shall_parse-0.6.1 → none_shall_parse-0.6.2}/src/none_shall_parse/parse.py +0 -0
- {none_shall_parse-0.6.1 → none_shall_parse-0.6.2}/src/none_shall_parse/strings.py +0 -0
- {none_shall_parse-0.6.1 → none_shall_parse-0.6.2}/src/none_shall_parse/types.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: none-shall-parse
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: Trinity Shared Python utilities.
|
|
5
5
|
Author: Andries Niemandt, Jan Badenhorst
|
|
6
6
|
Author-email: Andries Niemandt <andries.niemandt@trintel.co.za>, Jan Badenhorst <jan@trintel.co.za>
|
|
@@ -682,9 +682,21 @@ def get_notice_end_date(given_date: DateTimeLike | date | Date | None = None) ->
|
|
|
682
682
|
return end_date
|
|
683
683
|
|
|
684
684
|
|
|
685
|
-
def dt_to_za_time_string(v:
|
|
686
|
-
"""Convert DateTime to South Africa time string
|
|
687
|
-
|
|
685
|
+
def dt_to_za_time_string(v: DateTimeOrDateLike | None) -> str | None:
|
|
686
|
+
"""Convert DateTime or Date to South Africa time string.
|
|
687
|
+
|
|
688
|
+
For datetime objects: returns "YYYY-MM-DD HH:MM:SS" in ZA timezone.
|
|
689
|
+
For date objects: returns "YYYY-MM-DD" (no time component).
|
|
690
|
+
For None: returns None.
|
|
691
|
+
"""
|
|
692
|
+
if v is None:
|
|
693
|
+
return None
|
|
694
|
+
|
|
695
|
+
# Handle date objects (no time component)
|
|
696
|
+
if isinstance(v, date) and not isinstance(v, datetime):
|
|
697
|
+
return v.strftime("%Y-%m-%d")
|
|
698
|
+
|
|
699
|
+
# Convert datetime to Pendulum
|
|
688
700
|
naive = v.tzinfo is None
|
|
689
701
|
if naive:
|
|
690
702
|
pdt = pendulum.instance(v, tz=ZA_TZ)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|