Event.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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. }
  19. get startStr() {
  20. return this.start.toISOString();
  21. }
  22. get endStr() {
  23. return this.end.toISOString();
  24. }
  25. static toTimeSlot(obj) {
  26. if (obj instanceof Event) {
  27. return obj;
  28. }
  29. else {
  30. return new Event(obj);
  31. }
  32. }
  33. }
  34. exports.Event = Event;
  35. exports.default = Event;
  36. //# sourceMappingURL=Event.js.map