icalendar.prop.recur.month module#

BYMONTH value type of RECUR from RFC 5545 and RFC 7529.

class icalendar.prop.recur.month.vMonth(month, /, params=None)[source]#

Bases: int

The number of the month for recurrence.

In RFC 5545, this is just an int. In RFC 7529, this can be followed by L to indicate a leap month.

>>> from icalendar import vMonth
>>> vMonth(1) # first month January
vMonth('1')
>>> vMonth("5L") # leap month in Hebrew calendar
vMonth('5L')
>>> vMonth(1).leap
False
>>> vMonth("5L").leap
True

Definition from RFC:

type-bymonth = element bymonth {
   xsd:positiveInteger |
   xsd:string
}
classmethod from_ical(ical)[source]#
classmethod from_xcal(xml)[source]#

Parse xCal from RFC 6321.

Parameters:

xml (XCalParser | ElementAdapter | Element) – The XML to parse or a parser.

Raises:

XCalParsingError – If the provided xCal is invalid.

Return type:

VProp

property leap: bool#

Whether this is a leap month.

params: Parameters#
classmethod parse_jcal_value(value)[source]#

Parse a jCal value for vMonth.

Raises:

JCalParsingError – If the value is not a valid month.

Return type:

Self

to_ical()[source]#

The ical representation.

Return type:

bytes

to_xcal(element)[source]#

Add the xCal representation of this property according to RFC 6321.

Return type:

None