Skip to content

Commit

Permalink
fix(date-picker): specify partial type for flatpickrOptions (#2666)
Browse files Browse the repository at this point in the history
Signed-off-by: Hubert Flisijn <[email protected]>
Co-authored-by: Akshat Patel <[email protected]>
  • Loading branch information
flisijn and Akshat55 authored Mar 28, 2024
1 parent d1a4ee7 commit e8a195b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/datepicker/datepicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import flatpickr from "flatpickr";
import { NG_VALUE_ACCESSOR } from "@angular/forms";
import { carbonFlatpickrMonthSelectPlugin } from "./carbon-flatpickr-month-select";
import * as languages from "flatpickr/dist/l10n/index";
import { Options } from "flatpickr/dist/types/options";
import { DatePickerInput } from "carbon-components-angular/datepicker-input";
import { I18n } from "carbon-components-angular/i18n";

Expand Down Expand Up @@ -222,10 +223,10 @@ export class DatePicker implements
@Input() plugins = [];

@Input()
set flatpickrOptions(options) {
set flatpickrOptions(options: Partial<Options>) {
this._flatpickrOptions = Object.assign({}, this._flatpickrOptions, options);
}
get flatpickrOptions() {
get flatpickrOptions(): Partial<Options> {
const plugins = [...this.plugins, carbonFlatpickrMonthSelectPlugin];
if (this.range) {
plugins.push(rangePlugin({ input: `#${this.id}-rangeInput`, position: "left" }));
Expand All @@ -251,7 +252,7 @@ export class DatePicker implements

protected _value = [];

protected _flatpickrOptions = {
protected _flatpickrOptions: Partial<Options> = {
allowInput: true
};

Expand Down

0 comments on commit e8a195b

Please sign in to comment.