Skip to content

Add support for dynamic offset variables in date extension - #2529

Merged
Archigos merged 1 commit into
espanso:devfrom
gcailly:feature/dynamic-offset-variables
Dec 9, 2025
Merged

Archigos merged 1 commit into
espanso:devfrom
gcailly:feature/dynamic-offset-variables

Conversation

@gcailly

@gcailly gcailly commented Oct 11, 2025

Copy link
Copy Markdown
Contributor

Adds support for dynamic offset variables in the date extension.
The offset parameter can now accept both numbers and strings (for variable injection).
Maintains full backward compatibility with existing numeric offsets.

- Allow offset parameter to accept String in addition to Number
- Enables variable injection like offset: '{{hours_offset}}'
- Parse string offset to i64, ignore if invalid (no error)
- Add test for string offset: offset_with_string_works
- Add test for invalid string offset: offset_with_invalid_string_is_ignored
- Update JSON schema to accept ['number', 'string'] for offset
- Maintains full backward compatibility with numeric offsets
@smeech

smeech commented Oct 11, 2025

Copy link
Copy Markdown
Collaborator

Thank you!

@smeech

smeech commented Oct 12, 2025

Copy link
Copy Markdown
Collaborator

Now I just need an Espanso eval function instead of my shell scripts!

@AucaCoyan
AucaCoyan requested review from Archigos and removed request for AucaCoyan December 9, 2025 13:47
@Archigos
Archigos merged commit 9c05fbd into espanso:dev Dec 9, 2025
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.

3 participants