tobi-wan-kenobi / bumblebee-status

bumblebee-status is a modular, theme-able status line generator for the i3 window manager.
https://bumblebee-status.readthedocs.io/en/main/
MIT License
1.22k stars 228 forks source link

[contrib] added module persian_date #860

Closed Hame-daani closed 2 years ago

Hame-daani commented 2 years ago

Displays the current date and time in Persian(Jalali) Calendar.

tobi-wan-kenobi commented 2 years ago

Thank you very much for this contribution!

Pretty cool :)

I will merge right away, but one question for your consideration: Would it maybe make sense to eventually merge zhat into the existing datetime module? (for example, use jdatetime instead of datetime if a certain parameter is set, or even autodetect that from the system)

Thank you kindly!

Hame-daani commented 2 years ago

yeah, I thought the same since 99 percent of the code is duplicated.

I believe the better approach would be, to set a datetime library as an attribute in the class. and then the full_text method will use this attribute to get the date. and then other modules like the persian_date module can subclass this datetime module and set their own library to be used.

This way the road will be smoother for future modules since as far as I know there are other datetime libraries for other existing calendars.

I will work on this if you don't mind.

tobi-wan-kenobi commented 2 years ago

Sounds great and I would appreciate it a lot!