Skip to content

Commit

Permalink
fix(datetime): add non-null assertion to daysInMonth getter and diffe…
Browse files Browse the repository at this point in the history
…rence method
  • Loading branch information
achamorro-dev committed Nov 14, 2023
1 parent 8a176e1 commit dadb6c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/utils/src/datetime/datetime.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -114,7 +114,7 @@ export class Datetime {
}

get daysInMonth(): number {
return this._value.daysInMonth
return this._value.daysInMonth!
}

get year(): number {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit dadb6c9

Please sign in to comment.