UNPKG

@churchapps/helpers

Version:

Library of helper functions not specific to any one ChurchApps project or framework.

33 lines 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DonationHelper = void 0; 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; } } exports.DonationHelper = DonationHelper; //# sourceMappingURL=DonationHelper.js.map