xsoh / moment-hijri

A Hijri calendar (Based on Umm al-Qura calculations) plugin for moment.js
http://momentjs.com/docs/#/plugins/hijri/
MIT License
200 stars 82 forks source link

Adding a day gives type error in typescript, '"iDate"' is not assignable to parameter of type 'IUnitOfTime' #89

Closed himanshu2521992 closed 5 months ago

himanshu2521992 commented 5 months ago

When using nodejs and typescript, and adding a day to the date, typescript gives compilation error stating

Overload 1 of 3, '(amount: string | number, unit: IUnitOfTime): Moment', gave the following error. Argument of type '"iDate"' is not assignable to parameter of type 'IUnitOfTime'. Overload 2 of 3, '(amount?: DurationInputArg1, unit?: DurationConstructor | undefined): Moment', gave the following error.
Argument of type '"iDate"' is not assignable to parameter of type 'DurationConstructor | undefined'. Overload 3 of 3, '(unit: DurationConstructor, amount: string | number): Moment', gave the following error. Argument of type '2' is not assignable to parameter of type 'DurationConstructor'.