Event.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.Event = void 0;
  4. class Event {
  5. constructor(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. this.content = obj.content;
  19. }
  20. get startStr() {
  21. return this.start.toISOString();
  22. }
  23. get endStr() {
  24. return this.end.toISOString();
  25. }
  26. static toTimeSlot(obj) {
  27. if (obj instanceof Event) {
  28. return obj;
  29. }
  30. else {
  31. return new Event(obj);
  32. }
  33. }
  34. }
  35. exports.Event = Event;
  36. exports.default = Event;
  37. //# sourceMappingURL=Event.js.map