Skip to content

clock: add {month_name} placeholder with standalone month support - #5290

Closed
yars068 wants to merge 1 commit into
Alexays:masterfrom
yars068:POSIX_%OB_modifier_support
Closed

clock: add {month_name} placeholder with standalone month support#5290
yars068 wants to merge 1 commit into
Alexays:masterfrom
yars068:POSIX_%OB_modifier_support

Conversation

@yars068

@yars068 yars068 commented Aug 31, 2026

Copy link
Copy Markdown

This adds a support for POSIX %OB modifier of strftime() for clock/calendar module through a new placeholder {month_name}.

Introduce a new {month_name} placeholder for the clock module tooltip. Unlike the standard library formatting which wraps month names in a date context (often forcing genitive case in inflected languages like Slavic, Baltic, or Finno-Ugric), this placeholder utilizes the POSIX %OB modifier to retrieve the standalone (nominative) month name.

It can resolve #5241, #3890.

Mine clock module config section looks as follows:

    "clock": {
        "format"  : "{:%H:%M%n%d.%m.%Y}",
        "justify" : "center",
        "tooltip-format": "<span color='#ecc6d9'><b>{month_name} {:%Y}</b></span>\n<tt><small>{calendar}</small></tt>",
        "calendar": {
            "mode"          : "month",
            "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='#ffcc66'><b>Н.{}</b></span>",
                "weekdays":   "<span color='#ffcc66'><b>{}</b></span>",
                "today":      "<span color='#00a000'><b><u>{}</u></b></span>"
            },
        },
    }, 

@yars068 yars068 closed this Aug 31, 2026
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.

Date formatting within the Clock Calendar format

1 participant