Skip to content

Commit

Permalink
Support negation of temporal amount instances
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Jul 20, 2020
1 parent d05140d commit 396df7d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/groovy/net/fortuna/ical4j/groovy/PeriodExtension.groovy
Expand Up @@ -34,6 +34,8 @@ package net.fortuna.ical4j.groovy
import net.fortuna.ical4j.model.Period
import net.fortuna.ical4j.model.PeriodList

import java.time.Duration

class PeriodExtension {
static Period plus(Period self, Period period) {
self.add(period)
Expand All @@ -42,4 +44,12 @@ class PeriodExtension {
static PeriodList minus(Period self, Period period) {
self.subtract(period)
}

static java.time.Period negative(java.time.Period self) {
self.negated()
}

static Duration negative(Duration self) {
self.negated()
}
}

0 comments on commit 396df7d

Please sign in to comment.