Skip to content

Commit dadb6c9

Browse files
committed
fix(datetime): add non-null assertion to daysInMonth getter and difference method
1 parent 8a176e1 commit dadb6c9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/utils/src/datetime/datetime.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { DateTime as LuxonDatetime, Info } from 'luxon'
1+
import { Info, DateTime as LuxonDatetime } from 'luxon'
22
import { DateObject } from './date-object'
33
import { Duration } from './duration'
4-
import { StringUnitLength } from './string-unit-length'
54
import { InfoOptions } from './info-options'
5+
import { StringUnitLength } from './string-unit-length'
66

77
export interface DatetimeOptions {
88
isLocal: boolean
@@ -114,7 +114,7 @@ export class Datetime {
114114
}
115115

116116
get daysInMonth(): number {
117-
return this._value.daysInMonth
117+
return this._value.daysInMonth!
118118
}
119119

120120
get year(): number {
@@ -173,7 +173,7 @@ export class Datetime {
173173

174174
difference(datetime: Datetime): Duration {
175175
const iso8601 = this._value.diff(datetime._value).toISO()
176-
return Duration.fromIso(iso8601)
176+
return Duration.fromIso(iso8601!)
177177
}
178178

179179
toIso() {

0 commit comments

Comments
 (0)