fh-pydantic-form 0.3.0__py3-none-any.whl → 0.3.1__py3-none-any.whl

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.

Potentially problematic release.


This version of fh-pydantic-form might be problematic. Click here for more details.

@@ -820,11 +820,19 @@ class TimeFieldRenderer(BaseFieldRenderer):
820
820
  A TimeInput component appropriate for time values
821
821
  """
822
822
  formatted_value = ""
823
- if (
824
- isinstance(self.value, str) and len(self.value) == 5
825
- ): # Basic check for HH:MM format
826
- # Assume it's the correct string format from the form
827
- formatted_value = self.value
823
+ if isinstance(self.value, str):
824
+ # Try to parse the time string using various formats
825
+ time_formats = ["%H:%M", "%H:%M:%S", "%H:%M:%S.%f"]
826
+
827
+ for fmt in time_formats:
828
+ try:
829
+ from datetime import datetime
830
+
831
+ parsed_time = datetime.strptime(self.value, fmt).time()
832
+ formatted_value = parsed_time.strftime("%H:%M")
833
+ break
834
+ except ValueError:
835
+ continue
828
836
  elif isinstance(self.value, time):
829
837
  formatted_value = self.value.strftime("%H:%M") # HH:MM
830
838
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fh-pydantic-form
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: a library to turn any pydantic BaseModel object into a fasthtml/monsterui input form
5
5
  Project-URL: Homepage, https://github.com/Marcura/fh-pydantic-form
6
6
  Project-URL: Repository, https://github.com/Marcura/fh-pydantic-form
@@ -3,7 +3,7 @@ fh_pydantic_form/color_utils.py,sha256=M0HSXX0i-lSHkcsgesxw7d3PEAnLsZ46i_STymZAM
3
3
  fh_pydantic_form/comparison_form.py,sha256=TwlOCVmaY535zVzz01ZNSTpk5RkufQZEjAJuURwh5gQ,20986
4
4
  fh_pydantic_form/constants.py,sha256=-N9wzkibFNn-V6cO8iWTQ7_xBvwSr2hBdq-m3apmW4M,169
5
5
  fh_pydantic_form/defaults.py,sha256=Pwv46v7e43cykx4Pt01e4nw-6FBkHmPvTZK36ZTZqgA,6068
6
- fh_pydantic_form/field_renderers.py,sha256=iCCt8hKjfJedPwad5ASUzI6KpOhNW_4oxZRSShCoRtc,77581
6
+ fh_pydantic_form/field_renderers.py,sha256=UJo9zw6DcQA-GXagnBMzuhtYM1dwWZl82MPX2Y_3qJI,77866
7
7
  fh_pydantic_form/form_parser.py,sha256=mAsE5pE7A27k7zgHg4UD-P3HHQj9FmZneK_z68jLHbo,26117
8
8
  fh_pydantic_form/form_renderer.py,sha256=IHuO8cxbzuv0y5htiLp1csQ30ZRAnVP4v3qIMOvaZBM,36898
9
9
  fh_pydantic_form/list_path.py,sha256=AA8bmDmaYy4rlGIvQOOZ0fP2tgcimNUB2Re5aVGnYc8,5182
@@ -11,7 +11,7 @@ fh_pydantic_form/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  fh_pydantic_form/registry.py,sha256=sufK-85ST3rc3Vu0XmjjjdTqTAqgHr_ZbMGU0xRgTK8,4996
12
12
  fh_pydantic_form/type_helpers.py,sha256=JUzHT8YrWj2_g7f_Wr2GL9i3BgP1zZftFrrO8xDPeis,7409
13
13
  fh_pydantic_form/ui_style.py,sha256=UPK5OBwUVVTLnfvQ-yKukz2vbKZaT_GauaNB7OGc-Uw,3848
14
- fh_pydantic_form-0.3.0.dist-info/METADATA,sha256=Ze11LbQeBJu43_sG3_8009PSRNwamWdeohk7bxe5EBY,37067
15
- fh_pydantic_form-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
- fh_pydantic_form-0.3.0.dist-info/licenses/LICENSE,sha256=AOi2eNK3D2aDycRHfPRiuACZ7WPBsKHTV2tTYNl7cls,577
17
- fh_pydantic_form-0.3.0.dist-info/RECORD,,
14
+ fh_pydantic_form-0.3.1.dist-info/METADATA,sha256=Nx9k3ZQ53Jpnz37Z8eaqoal4d1UTIMwjLZrhV-PozOw,37067
15
+ fh_pydantic_form-0.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
+ fh_pydantic_form-0.3.1.dist-info/licenses/LICENSE,sha256=AOi2eNK3D2aDycRHfPRiuACZ7WPBsKHTV2tTYNl7cls,577
17
+ fh_pydantic_form-0.3.1.dist-info/RECORD,,