[PR #1243] [CLOSED] feat(date-widget): allow modifiers for strftime integer formatters #1270

Closed
opened 2026-01-05 14:54:42 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/LGUG2Z/komorebi/pull/1243
Author: @Samu-K
Created: 1/23/2025
Status: Closed

Base: masterHead: feature/date-modifiers


📝 Commits (3)

  • caf954e feat(date-widget): allow modifiers for strftime integer formatters
  • abf96eb Added ability for modifiers on strftime formatters
  • bcc4323 Added 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.

## 📋 Pull Request Information **Original PR:** https://github.com/LGUG2Z/komorebi/pull/1243 **Author:** [@Samu-K](https://github.com/Samu-K) **Created:** 1/23/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feature/date-modifiers` --- ### 📝 Commits (3) - [`caf954e`](https://github.com/LGUG2Z/komorebi/commit/caf954e6fc079ca6cd2c4ceab8b69dd8bdba6661) feat(date-widget): allow modifiers for strftime integer formatters - [`abf96eb`](https://github.com/LGUG2Z/komorebi/commit/abf96ebbeb107575f7249c1e3772d616a1229d9e) Added ability for modifiers on strftime formatters - [`bcc4323`](https://github.com/LGUG2Z/komorebi/commit/bcc4323d561939501ce2585ec18cc237482f7638) Added ability for modifiers on strftime formatters ### 📊 Changes **13 files changed** (+399 additions, -285 deletions) <details> <summary>View changed files</summary> 📝 `.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) </details> ### 📄 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. <!-- Please follow the Conventional Commits specification. If you need to update your PR with changes from `master`, please run `git rebase master`. By opening this PR, you confirm that you have read and understood this project's `CONTRIBUTING.md`. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-01-05 14:54:42 +01:00
adam closed this issue 2026-01-05 14:54:42 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#1270