Date
sereto.models.date
¶
Date
¶
Bases: SeretoBaseModel
Model representing a date with its associated event.
Attributes:
Name | Type | Description |
---|---|---|
type |
DateType
|
Type of the event. |
date |
SeretoDate | DateRange
|
Date or date range. |
Source code in sereto/models/date.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
DateRange
¶
Bases: SeretoBaseModel
Model representing a period of time with start and end date.
start
cannot be equal to end
. In that case you should use SeretoDate
.
Attributes:
Name | Type | Description |
---|---|---|
start |
SeretoDate
|
Start date of the period. |
end |
SeretoDate
|
End date of the period. |
Source code in sereto/models/date.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
DateType
¶
Bases: str
, Enum
Enum representing the event type for date.
Source code in sereto/models/date.py
61 62 63 64 65 66 67 |
|
SeretoDate
¶
Bases: RootModel[date]
Date representation for Pydantic with format %d-%b-%Y
.
The %d-%b-%Y
format string specifies the format of the date string as follows:
- %d
: Day of the month as a zero-padded decimal number (e.g. 01, 02, ..., 31).
- %b
: Month abbreviation in the current locale's abbreviated name (e.g. Jan, Feb, ..., Dec).
- %Y
: Year with century as a decimal number (e.g. 2021, 2022, ...).
Source code in sereto/models/date.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|