fetrarij / ngx-daterangepicker-material

Pure Angular 2+ date range picker with material design theme, a demo here:
https://fetrarij.github.io/ngx-daterangepicker-material/
MIT License
246 stars 247 forks source link

get and set should work with the same type #471

Open de87684333 opened 1 year ago

de87684333 commented 1 year ago

Versions

Describe the bug Code is not compiling due to this error in daterangepicker.component.d.ts : The return type of a 'get' accessor must be assignable to its 'set' accessor type Type 'null' is not assignable to type 'string | Dayjs'.

The issue is valid for attributes maxDate and minDate

To Reproduce Steps to reproduce the behavior:

  1. Compile

Expected behavior maxDate and minDate should have the same type so it's follow the typescript rules

de87684333 commented 1 year ago

It's working with the version 5.0.2. The issue started after the rework of getters.

sai-gmbh commented 1 year ago
Screenshot 2022-09-09 at 13 29 55

Do you have this issue in the pipeline?

Rapiiidooo commented 1 year ago

Having also this issue.

It should be the following :

    get minDate(): dayjs.Dayjs | string;
    set minDate(value: dayjs.Dayjs | string);
    get locale(): LocaleConfig;
    set locale(value: LocaleConfig);
    get ranges(): DateRanges;
    set ranges(value: DateRanges);
    get maxDate(): dayjs.Dayjs | string;
SubhradeepSengupta commented 1 year ago

The issue still persists with the latest v6.0.4. Can this be updated as per @Rapiiidooo comment?

Having also this issue.

It should be the following :

    get minDate(): dayjs.Dayjs | string;
    set minDate(value: dayjs.Dayjs | string);
    get locale(): LocaleConfig;
    set locale(value: LocaleConfig);
    get ranges(): DateRanges;
    set ranges(value: DateRanges);
    get maxDate(): dayjs.Dayjs | string;