Skip to content

Conversation

@WickyNilliams
Copy link
Owner

@WickyNilliams WickyNilliams commented Jun 4, 2025

Experimenting with adding custom commands: https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/command

With this, you can now do things like:

<button commandfor="date" command="--previous">Previous</button>
<button commandfor="date" command="--next">Next</button>
<button commandfor="date" command="--today">Today</button>

<calendar-date id="date">
  <calendar-month></calendar-month>
</calendar-date>

Letting you wire up functionality without any JS! It's only supported in Chrome right now, but it easily polyfilled, see here

Warning

When support for command is good enough, I am considering making this the default way to navigate pages i.e. cally will no longer render its own "previous" and "next" buttons.

This would of course be part of a major release since it would be a breaking change

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.

2 participants