bumblebee-status/bumblebee_status/modules/contrib/persian_date.py

32 lines
781 B
Python
Raw Normal View History

2022-03-04 15:58:13 +01:00
# pylint: disable=C0111,R0903
"""Displays the current date and time in Persian(Jalali) Calendar.
Requires the following python packages:
* jdatetime
Parameters:
* datetime.format: strftime()-compatible formatting string. default: "%A %d %B" e.g., "جمعه ۱۳ اسفند"
* datetime.locale: locale to use. default: "fa_IR"
"""
import jdatetime
import core.decorators
from modules.core.datetime import Module as dtmodule
2022-03-04 15:58:13 +01:00
class Module(dtmodule):
@core.decorators.every(minutes=1)
2022-03-04 15:58:13 +01:00
def __init__(self, config, theme):
super().__init__(config, theme, dtlibrary=jdatetime)
2022-03-04 15:58:13 +01:00
def default_format(self):
return "%A %d %B"
def default_locale(self):
return ("fa_IR", "UTF-8")
2022-03-04 15:58:13 +01:00
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4