Closed MickL closed 3 years ago
Hi @MickL , I'll take a look at this during the weekend. Thanks!
I added "null" to the example because when using the async pipe its return type is T | null
: {{ (myDate$ | async) | dfnsFormat: 'dd.MM.yyyy'}}
@MickL v7.0.2 implements this change.
Note that this has only been implemented for pipes that return a string representation of a date. The rest of the pipes that make calculations with dates are not affected because the input has to be valid.
Awesome :)
With Angular strict mode all inputs need to be optional:
Or using the async pipe returns
null
:But then the compiler is throwing an error with ngx-date-fns pipes, e.g.:
I would suggest to add strict typechecking to tsconfig:
and add a questionmark to all pipe inputs to support
undefined
and also acceptnull
, e.g. the format pipe: