Skip to content

feat: add border property to highlightedDates styles in Datetime #29833

Open
@ferreirajose

Description

@ferreirajose

Prerequisites

Describe the Feature Request

The Datetime Highlight Style type should accept one more item to be able to customize the calendar with highlighted dates.

Describe the Use Case

Aqui esta um exemplo pode isso poderia ser aplicado, para cada evento no mês ser possivel realizar esse tipo de customização

Vacation
Event in the month
Current date
Vacation + Current date
Vacation + Events

zO7o3Rj5

Describe Preferred Solution

Since the DatetimeHighlightStyle type already has 2 properties that allow you to customize highlighted dates, the suggestion would be to add a new border property that would be used as follows, for example:

highlightedDates: DatetimeHighlight[] = [
  {
      date: '2024-08-09',
      textColor: '#000',
      backgroundColor: '#FFCFAB',
      border: '1px solid red'
  }
  .....
  ]

Describe Alternatives

No response

Related Code

Here is a suggestion


export type DatetimeHighlightStyle =
  | {
      textColor: string;
      backgroundColor?: string;
      border?: string;
    }
  | {
      textColor?: string;
      backgroundColor: string;
      border?: string;
    };


return (
              <div class="calendar-day-wrapper">
                <button
                  ref={(el) => {
                    if (el) {
                      el.style.setProperty('color', `${dateStyle ? dateStyle.textColor : ''}`, 'important');
                      el.style.setProperty('border', `${dateStyle ? dateStyle.border : ''}`, 'important');
                      el.style.setProperty(
                        'background-color',
                        `${dateStyle ? dateStyle.backgroundColor : ''}`,
                        'important'
                      );
                    }
                  }}
                  .....
    );
  }

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions