withduration

This commit is contained in:
Jade (Rose) Rowland
2024-08-13 15:00:16 -04:00
parent 18d4fe0785
commit dd12b49f4d
+4
View File
@@ -65,6 +65,10 @@ export class TimeSpan {
// Applies given function to the end time of the timespan"""
return new TimeSpan(func_time(this.begin), this.end);
}
withDuration(func_time) {
const duration = this.end.sub(this.begin)
return new TimeSpan(this.begin, this.begin.add(func_time(duration)))
}
withCycle(func_time) {
// Like withTime, but time is relative to relative to the cycle (i.e. the