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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: none-shall-parse
3
- Version: 0.6.1
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>
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "none-shall-parse"
7
- version = "0.6.1"
7
+ version = "0.6.2"
8
8
  description = "Trinity Shared Python utilities."
9
9
  readme = "README.md"
10
10
  authors = [
@@ -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: DateTimeLike) -> str:
686
- """Convert DateTime to South Africa time string"""
687
- # Convert to Pendulum
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)