tithe
Version:
Organize and track the tithe payments.
30 lines (26 loc) • 896 B
JavaScript
;
/**
* Event
* Creates an event instance.
*
* @name Event
* @function
* @param {Object} options An object containing:
*
* - `desc` (String): The event description.
* - `val` (Number): The event value.
* - `date` (Date|String): The event date as date or parsable string.
* - `paid` (Boolean): A flag representing if the value is paid or not.
*
* @param {String} id An optional id.
* @return {Tenth.Event} The `Event` instance.
*/
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
module.exports = function Event(options, id) {
_classCallCheck(this, Event);
this.id = id;
this.desc = options.desc || "No description";
this.val = options.val;
this.date = options.date ? new Date(options.date) : new Date();
this.paid = options.paid;
};