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

Correctly format tztime #507

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Correctly format tztime #507

wants to merge 1 commit into from

Conversation

fspv
Copy link

@fspv fspv commented Nov 30, 2022

The format uses an incorrect source string to replate %time placeholder with the corresponding datetime value, as a result we output a format string instead of formatted value

The format uses an incorrect source string to replate %time placeholder
with the corresponding datetime value, as a result we output a format
string instead of formatted value
@fspv
Copy link
Author

fspv commented Nov 30, 2022

The problem is described here #491

Testing:

Before

build $ ninja && ./i3status
[3/3] Linking target i3status.
{"version":1}                                                                  
[                                                                              
[{"name":"tztime","instance":"UK","markup":"none","full_text":"%Y-%m-%d %I:%M:%S %P %Z"}]
,[{"name":"tztime","instance":"UK","markup":"none","full_text":"%Y-%m-%d %I:%M:%S %P %Z"}]

After

build $ ninja && ./i3status
[3/3] Linking target i3status.
{"version":1}                                                                  
[                                                                              
[{"name":"tztime","instance":"UK","markup":"none","full_text":"<span color='#00FF00'>2022-11-30 08:14:27 pm GMT</span>"}]
,[{"name":"tztime","instance":"UK","markup":"none","full_text":"<span color='#00FF00'>2022-11-30 08:14:28 pm GMT</span>"}]

Sample config

general {
    output_format = "i3bar"
}

order += "tztime UK"

tztime UK {
    format = "<span color='#00FF00'>%time</span>"
    format_time = "%Y-%m-%d %I:%M:%S %P %Z"
    timezone = "Europe/London"
}

@fspv
Copy link
Author

fspv commented Mar 18, 2023

Turns out it has already been reported here as well with exactly the same fix #465

This issue will be 2 years old soon

@4nd3r 4nd3r mentioned this pull request Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant