Skip to content

Calendar

Base classes

Name Children Inherits
QCalendar
PySide6.QtCore
QCalendar(self, /) -> None

⋔ Inheritance diagram

graph TD
  654287512["core.Calendar"]
  321432063["QtCore.QCalendar"]
  37984305["Shiboken.Object"]
  2751680898["builtins.object"]
  321432063 --> 654287512
  37984305 --> 321432063
  2751680898 --> 37984305

🛈 DocStrings

Bases: QCalendar

Describes calendar systems.

Source code in prettyqt/core/_calendar.py
class Calendar(core.QCalendar):
    """Describes calendar systems."""

    def __init__(self, system: str | core.QCalendar.System = "gregorian"):
        typ = system if isinstance(system, core.QCalendar.System) else SYSTEM[system]
        super().__init__(typ)

    def __repr__(self):
        return get_repr(self, self.name())

    def __reduce__(self):
        return type(self), (self.name().lower().replace(" ", "_"),)

    # def __bool__(self):
    #     return self.isValid()

    def get_date_from_parts(self, year: int, month: int, day: int) -> core.Date:
        return core.Date(self.dateFromParts(year, month, day))

:fa-brands-github: Show source on GitHub