Event.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.Event = void 0;
  4. var Event = (function () {
  5. function Event(obj) {
  6. this.id = obj.id;
  7. this.start = obj.start;
  8. this.end = obj.end;
  9. this.ressourceId = obj.ressourceId;
  10. this.title = (obj === null || obj === void 0 ? void 0 : obj.title) || this.id;
  11. this.isDisplayed = false;
  12. this.offset = 0;
  13. this.editable = (obj === null || obj === void 0 ? void 0 : obj.editable) === undefined ? null : obj.editable;
  14. this.ressourceEditable = (obj === null || obj === void 0 ? void 0 : obj.ressourceEditable) === undefined ? null : obj.ressourceEditable;
  15. this.moving = false;
  16. this.selected = false;
  17. this.bgColor = obj.bgColor;
  18. }
  19. Object.defineProperty(Event.prototype, "startStr", {
  20. get: function () {
  21. return this.start.toISOString();
  22. },
  23. enumerable: false,
  24. configurable: true
  25. });
  26. Object.defineProperty(Event.prototype, "endStr", {
  27. get: function () {
  28. return this.end.toISOString();
  29. },
  30. enumerable: false,
  31. configurable: true
  32. });
  33. Event.toTimeSlot = function (obj) {
  34. if (obj instanceof Event) {
  35. return obj;
  36. }
  37. else {
  38. return new Event(obj);
  39. }
  40. };
  41. return Event;
  42. }());
  43. exports.Event = Event;
  44. exports.default = Event;
  45. //# sourceMappingURL=Event.js.map