From dadb6c90858c293f0c8d021889daf528ad74f51b Mon Sep 17 00:00:00 2001 From: Alberto Chamorro Date: Tue, 14 Nov 2023 10:49:24 +0100 Subject: [PATCH] fix(datetime): add non-null assertion to daysInMonth getter and difference method --- packages/utils/src/datetime/datetime.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/utils/src/datetime/datetime.ts b/packages/utils/src/datetime/datetime.ts index a0687e4..98f4372 100644 --- a/packages/utils/src/datetime/datetime.ts +++ b/packages/utils/src/datetime/datetime.ts @@ -1,8 +1,8 @@ -import { DateTime as LuxonDatetime, Info } from 'luxon' +import { Info, DateTime as LuxonDatetime } from 'luxon' import { DateObject } from './date-object' import { Duration } from './duration' -import { StringUnitLength } from './string-unit-length' import { InfoOptions } from './info-options' +import { StringUnitLength } from './string-unit-length' export interface DatetimeOptions { isLocal: boolean @@ -114,7 +114,7 @@ export class Datetime { } get daysInMonth(): number { - return this._value.daysInMonth + return this._value.daysInMonth! } get year(): number { @@ -173,7 +173,7 @@ export class Datetime { difference(datetime: Datetime): Duration { const iso8601 = this._value.diff(datetime._value).toISO() - return Duration.fromIso(iso8601) + return Duration.fromIso(iso8601!) } toIso() {