Event.js 1.3 KB

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