multiple format strings in clock.format #2538
-
I'd like to have two format strings for the clock module. However, when I try something like ``"clock": { "format": " {:%H:%M:%S} {:%F}", After a bit of trial and error, I found that |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
HI @genevieve-me , "clock": {
"format": "{: %H:%M:%S %F}",
"interval": 60,
"format-alt": "{:%A, %B %d, %Y (%R) %Z} ",
// "tooltip-format": "<span size='12pt' font='Sarasa Mono SC'>{calendar}</span>",
"tooltip-format": "<small><tt>{calendar}</tt></small>",
// "tooltip-format": "{tz_list}<small><tt>{calendar}</tt></small>\n{:%Ec}",
"timezones" : ["" , "Europe/Warsaw", "America/Chicago"],
"calendar": {
"mode" : "year",
"mode-mon-col" : 3,
"weeks-pos" : "right",
"on-scroll" : 1,
"format": {
"months": "<span color='#ffead3'><b>{}</b></span>",
"days": "<span color='#ecc6d9'><b>{}</b></span>",
"weeks": "<span color='#99ffdd'><b>W{:%U}</b></span>",
"weekdays": "<span color='#ffcc66'><b>{}</b></span>",
"today": "<span color='#ff6699'><b><u>{}</u></b></span>"
}
},
"actions": {
"on-click-right": "mode",
"on-click-forward": "tz_up",
"on-click-backward": "tz_down",
"on-scroll-up": "shift_up",
"on-scroll-down": "shift_down"
},
},
|
Beta Was this translation helpful? Give feedback.
-
Do you use standard clock or simple clock ? See Wiki about this |
Beta Was this translation helpful? Give feedback.
-
hey @genevieve-me and others who'll need it you can use positional arguments to have multiple format strings:
Notice the |
Beta Was this translation helpful? Give feedback.
hey @genevieve-me and others who'll need it
you can use positional arguments to have multiple format strings:
"clock": { "format": "{0:%H:%M:%S} {0:%F}" }
Notice the
0
before the first semicolon in format string.