We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06fc764 commit 8afb5f6Copy full SHA for 8afb5f6
1 file changed
pyvalueobjects/dates/isodate.py
@@ -5,11 +5,23 @@
5
6
7
class IsoDate(String):
8
+ """
9
+ A value object representing a date in ISO format. Inherits from String and validates that the input is a valid ISO date string.
10
11
12
def __init__(self, value: str):
13
14
+ Initialize the IsoDate object with the given ISO date string.
15
+ :param value: A string representing a date in ISO format.
16
17
super().__init__(value)
18
19
def _validate(self, value):
20
21
+ Validate that the given value is a valid ISO date string.
22
+ :param value: The string to validate.
23
+ :raises: ValueObjectError if the value is not a valid ISO date string.
24
25
super()._validate(value)
26
try:
27
datetime.datetime.fromisoformat(value)
0 commit comments