Skip to content

Commit

Permalink
chore: added minDate and maxDate checks in the datepicker (#3060)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akshat55 authored Nov 25, 2024
2 parents f1d1f16 + c428711 commit 6febdbd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/datepicker/datepicker.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ const RangeTemplate = (args) => ({
[rangeInvalid]="invalid"
[rangeInvalidText]="invalidText"
[dateFormat]="dateFormat"
[flatpickrOptions]="flatpickrOptions"
[value]="value"
(valueChange)="valueChange($event)"
[helperText]="helperText">
Expand All @@ -154,6 +155,7 @@ const RangeTemplate = (args) => ({
[rangeWarn]="warn"
[rangeWarnText]="warnText"
[dateFormat]="dateFormat"
[flatpickrOptions]="flatpickrOptions"
(valueChange)="valueChange($event)"
[helperText]="helperText">
</cds-date-picker>
Expand All @@ -162,8 +164,12 @@ const RangeTemplate = (args) => ({
export const Range = RangeTemplate.bind({});
Range.args = {
dateFormat: "d/m/Y",
value: ["01/02/24", "08/02/24"],
language: "en"
value: ["02/11/24", "08/11/24"],
language: "en",
flatpickrOptions: {
minDate: new Date("11/01/24"),
maxDate: new Date("11/30/24"),
}
};
Range.argTypes = {
language: {
Expand Down

0 comments on commit 6febdbd

Please sign in to comment.