mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[PR #1243] [CLOSED] feat(date-widget): allow modifiers for strftime integer formatters #1270
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/LGUG2Z/komorebi/pull/1243
Author: @Samu-K
Created: 1/23/2025
Status: ❌ Closed
Base:
master← Head:feature/date-modifiers📝 Commits (3)
caf954efeat(date-widget): allow modifiers for strftime integer formattersabf96ebAdded ability for modifiers on strftime formattersbcc4323Added ability for modifiers on strftime formatters📊 Changes
13 files changed (+399 additions, -285 deletions)
View changed files
📝
.github/ISSUE_TEMPLATE/bug_report.yml(+2 -2)📝
.github/ISSUE_TEMPLATE/feature_request.yml(+8 -8)➕
.github/workflows/feature-check.yaml(+47 -0)➖
.github/workflows/sponsor-check.yaml(+0 -125)📝
docs/common-workflows/komorebi-config-home.md(+10 -0)📝
komorebi-bar/src/date.rs(+55 -3)📝
komorebi/src/core/default_layout.rs(+8 -17)📝
komorebi/src/lib.rs(+2 -0)📝
komorebi/src/static_config.rs(+10 -0)📝
komorebi/src/window.rs(+48 -13)📝
komorebi/src/window_manager.rs(+0 -11)📝
schema.bar.json(+175 -105)📝
schema.json(+34 -1)📄 Description
Added the ability of use modifiers with custom format.
For example if using %U returns 04, you can add a modifier so that bar date widget shows 05. Config is formatted like format: {"Custom": {"Custom": format_str, "Modifiers": {formatter: mod_value}}}
Accepts config with format: {"Custom": format_str}, so does not break any existing configs.
The reason for this change is because I'd like to display the week number, starting from 1, but strftime only has options to start from 0, so the only option is to modify the starting value by 1. I then expanded this ability to any other numerical value.
Current notes:
This does not take into account "overflows" with dates or months, so it could make you display month 13 or day 32.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.