i3pyblocks.blocks.datetime
Blocks based on datetime.
Module Contents
Classes
Block that shows date and time for current location. |
- class i3pyblocks.blocks.datetime.DateTimeBlock(format_date: str = '%D', format_time: str = '%T', sleep: int = 1, **kwargs)
Bases:
i3pyblocks.blocks.PollingBlockBlock that shows date and time for current location.
This blocks alternates between Time and Date display by clicks in the Block. Keep in mind that
format_dateandformat_timenames are arbitrary and both formats have capacity to display both date and time.- Parameters
format_date – Format string when showing date. Uses strftime placeholders.
format_time – Format string when showing time. Uses strftime placeholders.
sleep – Sleep in seconds between each call to
run(). If you’re not showing seconds in this block it makes sense to increase this value.**kwargs – Extra arguments to be passed to
PollingBlockclass.
- toggle_date_time(self) None
- async click_handler(self, **_kwargs) None
- async run(self) None