@revolugo/common 6.13.1-beta.33 → 6.13.1-beta.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revolugo/common",
3
- "version": "6.13.1-beta.33",
3
+ "version": "6.13.1-beta.35",
4
4
  "private": false,
5
5
  "description": "Revolugo common",
6
6
  "author": "Revolugo",
@@ -502,3 +502,12 @@ export function adjustForCustomers(
502
502
  dateTo: adjustIfFullHour(policy.dateTo).format(),
503
503
  }))
504
504
  }
505
+
506
+ export function isFreeCancellable(cps: ICancellationPolicy[]): boolean {
507
+ const freeCp = cps.find(cp => cp.penaltyPercentage === 0)
508
+ return (
509
+ !!freeCp &&
510
+ (dayjs().isBefore(dayjs(freeCp.dateFrom)) ||
511
+ dayjs().isBetween(dayjs(freeCp.dateFrom), dayjs(freeCp.dateTo)))
512
+ )
513
+ }