microsoft / microsoft/AdaptiveCards

[Feature Request] allow disabled dates in datepicker

Open
#8,872 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Request
Dominant language
C#
Stars
2k
Forks
595
Avg merge
1d 19h
Merged PRs (30d)
1

Description

Problem Statement

It is a pretty common use case for bots to use Input.Date for appointment booking. We would want users to pick one from all the available dates. Currently adaptive card Input.Date only supports min and max dates. It would be very nice if it also supports restricted dates like fluent UI https://react.fluentui.dev/?path=/docs/compat-components-calendar--default so we can disable unavailable dates.

Proposed solution

I see that the original Input.Date uses html datepicker which doesn't have a restricted dates options but AC can support fluent UI and fluent UI datepicker supports restricted dates. I propose to add restricted dates in the schema and add it as a parameter for Input.Date component.

Alternatives or Workarounds

I tried to write custom element like this https://learn.microsoft.com/en-us/adaptive-cards/sdk/rendering-cards/javascript/extensibility but the problem is that if I add a restrictedDates field to my inpute.Date element in the json I send from the bot, this field will be dropped because it is not in the schema

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Adaptive Cards schema definition for Input.Date and the platform renderers that consume it. Review how min and max dates are passed to the datepicker, then determine how a restrictedDates property can be preserved by schema validation and applied consistently. Done means the property is accepted and unavailable dates cannot be selected.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, react
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.