@churchapps/apphelper-donations
Version:
Donation components for ChurchApps AppHelper
29 lines • 931 B
JavaScript
export class DonationHelper {
static getInterval(intervalName) {
let intervalCount = 1;
let intervalType = "month";
let parts = intervalName.split("_");
if (parts.length === 2) {
switch (parts[0]) {
case "two":
intervalCount = 2;
break;
case "three":
intervalCount = 3;
break;
}
intervalType = parts[1];
}
let result = { interval_count: intervalCount, interval: intervalType };
return result;
}
static getIntervalKeyName(intervalCount, intervalType) {
let firstPart = "one";
if (intervalCount === 2)
firstPart = "two";
else if (intervalCount === 3)
firstPart = "three";
return firstPart + "_" + intervalType;
}
}
//# sourceMappingURL=DonationHelper.js.map