Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for date segment to take a timezone argument #1337

Closed

Conversation

shawncplus
Copy link

I wanted the functionally to have two clocks of different timezones in my powerline, this did the trick.

install_requires=[],
install_requires=[
'pytz'
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should make this optional.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you saying making the feature altogether optional if they have pytz installed? That makes sense.

@shawncplus
Copy link
Author

I have no idea if I did the optional bits correctly but it seems work correctly with pytz installed and not and raises proper errors when trying to use unavailable functionality


Divider highlight group used: ``time:divider``.

Highlight groups used: ``time`` or ``date``.
'''

if (tz):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not use parenthesis here.

@PH111P
Copy link
Member

PH111P commented Oct 11, 2019

While I like the idea of the time segment taking an optional timezone parameter, I'm not quite convinced by the implementation presented here:

  • Another package is required for functionality that should be easily doable with vanilla python. In particular, specifying the timezone as +HHMM or -HHMM would allow the use of strptime (%z).
  • The fuzzy_time segment should also get timezone support (this should be a minor issue though)
  • I find calling the additional parameter tz not optimal; better would be something more intuitive like timezone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants