⏳ date-fns pipes for Angular
Added a bunch of new is*
pipes:
dfnsIsExists
dfnsIsFirstDayOfMonth
dfnsIsFriday
dfnsIsLastDayOfMonth
dfnsIsLeapYear
dfnsIsMatch
dfnsIsMatchPure
dfnsIsMonday
dfnsIsSameDay
dfnsIsSameHour
dfnsIsSameISOWeekYear
dfnsIsSameISOWeek
dfnsIsSameMinute
dfnsIsSameMonth
dfnsIsSameQuarter
dfnsIsSameSecond
dfnsIsSameWeek
dfnsIsSameWeekPure
dfnsIsSameYear
dfnsIsSaturday
dfnsIsSunday
dfnsIsThisHour
dfnsIsThisISOWeek
dfnsIsThisMinute
dfnsIsThisMonth
dfnsIsThisQuarter
dfnsIsThisSecond
dfnsIsThisWeek
dfnsIsThisWeekPure
dfnsIsThisYear
dfnsIsThursday
dfnsIsToday
dfnsIsTomorrow
dfnsIsTuesday
dfnsIsWednesday
dfnsIsWithinInterval
dfnsIsYesterday
🎉 Great contribution by @joarkm1 🎉
format*
pipes (the ones that return string
) now accept null
and undefined
. This was necessary to avoid type errors when using the async
pipe in strict
mode. (related to #347)The following pipes:
dfnsFormatDistanceStrict
dfnsFormatDistanceStrictPure
dfnsFormatDistanceToNow
dfnsFormatDistanceToNowPure
dfnsFormatDistance
dfnsFormatDistancePure
dfnsFormat
dfnsFormatPure
don't throw an exception anymore when an invalid date is provided, an empty string is returned instead.
This change only affects you in case you were calling any of those pipes programmatically and using the exception via a try catch
statement. If this is the case, you can now safely remove the try catch
and check for an empty string
instead.