ngx-daterangepicker-material icon indicating copy to clipboard operation
ngx-daterangepicker-material copied to clipboard

get and set should work with the same type

Open de87684333 opened this issue 2 years ago • 4 comments

Versions

  • Angular version: 14.2.0
  • typescript: 4.7.4
  • ngx-daterangepicker-material: 6.0.2

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 avatar Aug 31 '22 16:08 de87684333

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

de87684333 avatar Sep 01 '22 14:09 de87684333

Screenshot 2022-09-09 at 13 29 55

Do you have this issue in the pipeline?

sai-gmbh avatar Sep 09 '22 11:09 sai-gmbh

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;

Rapiiidooo avatar Sep 30 '22 15:09 Rapiiidooo

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;

SubhradeepSengupta avatar Jun 20 '23 12:06 SubhradeepSengupta