Skip to content

Correctly format tztime#507

Open
fspv wants to merge 1 commit into
i3:mainfrom
fspv:main
Open

Correctly format tztime#507
fspv wants to merge 1 commit into
i3:mainfrom
fspv:main

Conversation

@fspv

@fspv fspv commented Nov 30, 2022

Copy link
Copy Markdown

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

fspv commented Nov 30, 2022

Copy link
Copy Markdown
Author

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

fspv commented Mar 18, 2023

Copy link
Copy Markdown
Author

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.

1 participant