Skip to content

Commit 8afb5f6

Browse files
committed
Add docs at dates
1 parent 06fc764 commit 8afb5f6

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

pyvalueobjects/dates/isodate.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,23 @@
55

66

77
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+
"""
811

912
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+
"""
1017
super().__init__(value)
1118

1219
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+
"""
1325
super()._validate(value)
1426
try:
1527
datetime.datetime.fromisoformat(value)

0 commit comments

Comments
 (0)