Skip to content

Add dadd package#228

Open
undergrinder wants to merge 1 commit into
espanso:mainfrom
undergrinder:main
Open

Add dadd package#228
undergrinder wants to merge 1 commit into
espanso:mainfrom
undergrinder:main

Conversation

@undergrinder

Copy link
Copy Markdown

This package is an utility for quick date calculation like insert the date that is +12 from tomorrow, or -5 day from today.

homepage: "https://github.com/undergrinder/espanso-hub/tree/main/packages/dadd/0.1.0"
version: 0.1.0
author: undergrinder
tags: ["math", "utility"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you kindly add some additional tags, such as "date", "python" etc. as in my own date-offset packages, please?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, thank you for all the observation, I try to fix all of them as soon as possible.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're welcome. Let me know if you'd like any help.


The output will be also in YYYY-MM-DD format.

# Installation

@smeech smeech May 26, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could omit installation instructions as they'll be added to the Hub page automatically.
I suppose there's an argument for including them in case someone is browsing the espanso/hub repo instead, but the espanso restart will happen automaticaly so isn't required anyway.


The package contain only one trigger that is :dadd (short for date add).

![screenshot](screenshot.png)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the inclusion of the screenshot. We might find the Hub frontend fails as a result, however. Let's see!

@smeech smeech left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small package with a single trigger and a straightforward Python script, not unlike the one I used in my own package. No potentially malicious code, AFAICS.

I've left a couple of suggestions, will let Copilot do its stuff, and I'll run the automated checks to see if it balks at the README.md image.

Thank you.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Espanso Hub package (dadd) that provides a :dadd form-based trigger for adding/subtracting days from a base date and outputting the resulting date.

Changes:

  • Added :dadd match with a form input and a Python-backed date calculation script.
  • Added package documentation (README + screenshot).
  • Added package manifest metadata for Hub distribution.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 6 comments.

File Description
packages/dadd/0.1.0/package.yml Defines the :dadd trigger, collects form inputs, and computes the resulting date via Python.
packages/dadd/0.1.0/README.md Documents usage, inputs, and installation steps with a screenshot.
packages/dadd/0.1.0/_manifest.yml Adds Hub metadata (name, version, homepage, tags).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +28 to +29
dt = datetime.strptime(clean_input, '%Y-%m-%d')
print(f"{dt + timedelta(days=int('{{input_dateadd.dayTimeDelta}}'))}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. 1958-03-18 00:00:00 doesn't really make sense when all you want is 1958-03-18.

- -c
- |
from datetime import datetime, timedelta
clean_input = '{{input_dateadd.dateBase}}'.strip("' \"").replace('.', '-')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree.

Comment on lines +23 to +25
from datetime import datetime, timedelta
clean_input = '{{input_dateadd.dateBase}}'.strip("' \"").replace('.', '-')
if clean_input in ['now', 'today']:

@smeech smeech May 26, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's necessary - the trigger will simply fail if the user enters invalid characters.

Comment on lines +3 to +6
This package is an utility for quick date calculation like insert the date that is +12 from tomorrow,
or -5 day from today.

The package contain only one trigger that is :dadd (short for date add).
Comment on lines +10 to +12
The form has two field:
- Day num: Number of days to add or extract. For extraction use negative number.
- Date base (YYYY-MM-DD format): The date that will be used for add or extract. 'Today' and 'Now' are also valid values. 'Today' is the default.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree.

@@ -0,0 +1,7 @@
name: "dadd"
title: "Date add package"
description: An utility for quick date calculations

@smeech smeech May 26, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, it would be nice. The description: value forms the text at the top of the package's Hub page.

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