We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac5ec5f commit a962bdeCopy full SHA for a962bde
core/common/src/DateTimePeriod.kt
@@ -459,6 +459,8 @@ public operator fun DateTimePeriod.minus(other: DateTimePeriod) : DateTimePeriod
459
safeAdd(totalNanoseconds, -other.totalNanoseconds)
460
)
461
462
+public operator fun DateTimePeriod.unaryMinus(): DateTimePeriod = buildDateTimePeriod(-totalMonths, -days, -totalNanoseconds)
463
+
464
/**
465
* Adds two [DatePeriod] instances.
466
*
@@ -478,3 +480,5 @@ public operator fun DatePeriod.minus(other: DatePeriod): DatePeriod = DatePeriod
478
480
safeAdd(totalMonths, -other.totalMonths),
479
481
safeAdd(days, -other.days)
482
483
484
+public operator fun DatePeriod.unaryMinus(): DatePeriod = DatePeriod(-totalMonths, -days)
0 commit comments