You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
now in ngOnInit() I want to assign value to minEndDate to be 1 day after the tomorrowsDate, so the following this.minEndDate = addDays(this.tomorrowsDate(), 1);
but I get an error here TS2739: Type Date is missing the following properties from type TZDate: timeZone, withTimeZone, [constructFromSymbol], its treating the addDays(this.tomorrowsDate(), 1); as if it returns a Date.
If i assign the addDays(this.tomorrowsDate(), 1); to a variable first, for example: const oneMoreDay = addDays(this.tomorrowsDate(), 1);
and then assign it to the minEndDate variable: this.minEndDate = oneMoreDay
This works normally and as expected,
Do you have any idea why this is happening, is it a bug or am I doing something wrong?
The minEndDate cannot be a computed signal because I'm reassigning it later in the code, it depends on a date picker input.
I also get the correct output when doing the following:
I have these variables defined in my component:
now in
ngOnInit()
I want to assign value tominEndDate
to be 1 day after thetomorrowsDate
, so the followingthis.minEndDate = addDays(this.tomorrowsDate(), 1);
but I get an error here
TS2739: Type Date is missing the following properties from type TZDate: timeZone, withTimeZone, [constructFromSymbol]
, its treating theaddDays(this.tomorrowsDate(), 1);
as if it returns a Date.If i assign the
addDays(this.tomorrowsDate(), 1);
to a variable first, for example:const oneMoreDay = addDays(this.tomorrowsDate(), 1);
and then assign it to the minEndDate variable:
this.minEndDate = oneMoreDay
This works normally and as expected,
Do you have any idea why this is happening, is it a bug or am I doing something wrong?
The minEndDate cannot be a computed signal because I'm reassigning it later in the code, it depends on a date picker input.
I also get the correct output when doing the following:
but I don't get it why would I need timezone information when the
this.tomorrowsDate()
is already a TZDateThe text was updated successfully, but these errors were encountered: