BusinessOpeningHoursInterval¶
- class telegram.BusinessOpeningHoursInterval(opening_minute, closing_minute, *, api_kwargs=None)[source]¶
Bases:
telegram.TelegramObject
This object describes an interval of time during which a business is open.
Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their
opening_minute
andclosing_minute
are equal.Available In
Added in version 21.1.
Examples
A day has (24 * 60 =) 1440 minutes, a week has (7 * 1440 =) 10080 minutes. Starting the the minute’s sequence from Monday, example values of
opening_minute
,closing_minute
will map to the following day times:- Monday - 8am to 8:30pm:
opening_minute = 480
8 * 60closing_minute = 1230
20 * 60 + 30
- Tuesday - 24 hours:
opening_minute = 1440
24 * 60closing_minute = 2879
2 * 24 * 60 - 1
- Sunday - 12am - 11:58pm:
opening_minute = 8640
6 * 24 * 60closing_minute = 10078
7 * 24 * 60 - 2
- Parameters:
opening_minute (
int
) – The minute’s sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60.closing_minute (
int
) – The minute’s sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60
- opening_minute[source]¶
The minute’s sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60.
- Type:
- closing_minute[source]¶
The minute’s sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60
- Type:
- property closing_time[source]¶
Convenience attribute. A
tuple
parsed fromclosing_minute
. It contains the weekday, hour and minute in the same ranges asdatetime.datetime.weekday
,datetime.datetime.hour
anddatetime.datetime.minute
- property opening_time[source]¶
Convenience attribute. A
tuple
parsed fromopening_minute
. It contains the weekday, hour and minute in the same ranges asdatetime.datetime.weekday
,datetime.datetime.hour
anddatetime.datetime.minute