(date_input: str | datetime, format_str: str = "%d.%m.%Y")
| 87 | |
| 88 | @staticmethod |
| 89 | def _format_date(date_input: str | datetime, format_str: str = "%d.%m.%Y") -> str: |
| 90 | try: |
| 91 | if isinstance(date_input, str): |
| 92 | if "T" in date_input: |
| 93 | date_obj = datetime.fromisoformat(date_input.replace("Z", "+00:00")) |
| 94 | else: |
| 95 | date_obj = datetime.strptime(date_input, "%Y-%m-%d") |
| 96 | else: |
| 97 | date_obj = date_input |
| 98 | return date_obj.strftime(format_str) |
| 99 | except: |
| 100 | return str(date_input) |
| 101 | |
| 102 | @staticmethod |
| 103 | def _format_currency(amount: float, currency: str = "$") -> str: |
nothing calls this directly
no outgoing calls
no test coverage detected