feat(bar): add modifiers for strftime integer formatters

Added the ability of use modifiers with custom format on the Date widget.

For example if using %U returns 04, you can add a modifier so that bar
date widget shows 05.
This commit is contained in:
Samu-K
2025-01-23 22:07:05 +02:00
committed by LGUG2Z
parent 4f041123d1
commit cfd89c274c
2 changed files with 150 additions and 3 deletions

View File

@@ -198,6 +198,38 @@
}
},
"additionalProperties": false
},
{
"description": "Custom format with modifiers",
"type": "object",
"required": [
"CustomModifiers"
],
"properties": {
"CustomModifiers": {
"description": "Custom format with additive modifiers for integer format specifiers",
"type": "object",
"required": [
"format",
"modifiers"
],
"properties": {
"format": {
"description": "Custom format (https://docs.rs/chrono/latest/chrono/format/strftime/index.html)",
"type": "string"
},
"modifiers": {
"description": "Additive modifiers for integer format specifiers (e.g. { \"%U\": 1 } to increment the zero-indexed week number by 1)",
"type": "object",
"additionalProperties": {
"type": "integer",
"format": "int32"
}
}
}
}
},
"additionalProperties": false
}
]
},
@@ -1413,6 +1445,38 @@
}
},
"additionalProperties": false
},
{
"description": "Custom format with modifiers",
"type": "object",
"required": [
"CustomModifiers"
],
"properties": {
"CustomModifiers": {
"description": "Custom format with additive modifiers for integer format specifiers",
"type": "object",
"required": [
"format",
"modifiers"
],
"properties": {
"format": {
"description": "Custom format (https://docs.rs/chrono/latest/chrono/format/strftime/index.html)",
"type": "string"
},
"modifiers": {
"description": "Additive modifiers for integer format specifiers (e.g. { \"%U\": 1 } to increment the zero-indexed week number by 1)",
"type": "object",
"additionalProperties": {
"type": "integer",
"format": "int32"
}
}
}
}
},
"additionalProperties": false
}
]
},
@@ -2561,6 +2625,38 @@
}
},
"additionalProperties": false
},
{
"description": "Custom format with modifiers",
"type": "object",
"required": [
"CustomModifiers"
],
"properties": {
"CustomModifiers": {
"description": "Custom format with additive modifiers for integer format specifiers",
"type": "object",
"required": [
"format",
"modifiers"
],
"properties": {
"format": {
"description": "Custom format (https://docs.rs/chrono/latest/chrono/format/strftime/index.html)",
"type": "string"
},
"modifiers": {
"description": "Additive modifiers for integer format specifiers (e.g. { \"%U\": 1 } to increment the zero-indexed week number by 1)",
"type": "object",
"additionalProperties": {
"type": "integer",
"format": "int32"
}
}
}
}
},
"additionalProperties": false
}
]
},