feat: ability to limit the max expiration of a share

This commit is contained in:
Elias Schneider
2023-10-23 15:17:47 +02:00
parent 46b6e56c06
commit bbfc9d6f14
9 changed files with 152 additions and 57 deletions

View File

@@ -0,0 +1,12 @@
import * as moment from "moment";
export function parseRelativeDateToAbsolute(relativeDate: string) {
if (relativeDate == "never") return moment(0).toDate();
return moment()
.add(
relativeDate.split("-")[0],
relativeDate.split("-")[1] as moment.unitOfTime.DurationConstructor,
)
.toDate();
}