From: Aarni Koskela Date: Tue, 25 Jan 2022 13:30:30 +0000 (+0200) Subject: Improve documentation for TimezoneTransition X-Git-Tag: v2.10.0~23^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0531bc9e17879f64c6f89e355905ea4037cbbf8a;p=thirdparty%2Fbabel.git Improve documentation for TimezoneTransition Fixes #823 --- diff --git a/babel/dates.py b/babel/dates.py index 816149d1..f94c60a0 100644 --- a/babel/dates.py +++ b/babel/dates.py @@ -255,17 +255,22 @@ def get_next_timezone_transition(zone=None, dt=None): class TimezoneTransition(object): """A helper object that represents the return value from :func:`get_next_timezone_transition`. + + :field activates: + The time of the activation of the timezone transition in UTC. + :field from_tzinfo: + The timezone from where the transition starts. + :field to_tzinfo: + The timezone for after the transition. + :field reference_date: + The reference date that was provided. This is the `dt` parameter + to the :func:`get_next_timezone_transition`. """ def __init__(self, activates, from_tzinfo, to_tzinfo, reference_date=None): - #: the time of the activation of the timezone transition in UTC. self.activates = activates - #: the timezone from where the transition starts. self.from_tzinfo = from_tzinfo - #: the timezone for after the transition. self.to_tzinfo = to_tzinfo - #: the reference date that was provided. This is the `dt` parameter - #: to the :func:`get_next_timezone_transition`. self.reference_date = reference_date @property diff --git a/docs/api/dates.rst b/docs/api/dates.rst index f3e59b63..55ea2b16 100644 --- a/docs/api/dates.rst +++ b/docs/api/dates.rst @@ -42,6 +42,8 @@ Timezone Functionality A timezone object for the computer's local timezone. +.. autoclass:: TimezoneTransition + Data Access -----------