MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / r

Function r

codebase/dhtmlxscheduler.es.js:45–102  ·  view source on GitHub ↗
(d)

Source from the content-addressed store, hash-verified

43 return h != "timeline" && h != "month" || (u = { ...u, end_date: e.date.add(l.start_date, 1, "minute") }), m && (c[p] = m, u.sections = c), u;
44 }
45 function r(d) {
46 const { layout: l } = d;
47 let h;
48 switch (l) {
49 case "month":
50 h = function(p) {
51 let m = [];
52 const { event: g, layout: c, viewName: u, sectionId: f } = p, y = [];
53 let w = new Date(g.start_date);
54 for (; w.valueOf() < g.end_date.valueOf(); ) {
55 let M = { start_date: w };
56 y.push(M), w = e.date.week_start(e.date.add(w, 1, "week"));
57 }
58 let D = e.$container.querySelectorAll(`[${e.config.event_attribute}='${g.id}']`);
59 for (let M = 0; M < D.length; M++) {
60 const k = { event: y[M], layout: c, viewName: u, sectionId: f, eventNode: D[M].cloneNode(!0) };
61 m.push(_(k));
62 }
63 return m;
64 }(d);
65 break;
66 case "timeline":
67 case "units":
68 h = function(p) {
69 let m = [];
70 const { event: g, layout: c, viewName: u, eventNode: f } = p;
71 let y = function(w) {
72 const D = e.getView(w);
73 return D.y_property ? D.y_property : D.map_to ? D.map_to : void 0;
74 }(u);
75 if (y) {
76 const w = String(g[y]).split(e.config.section_delimiter).map((M) => String(M)), D = [];
77 for (let M = 0; M < w.length; M++) {
78 D[M] = f.cloneNode(!0);
79 const k = { event: g, layout: c, viewName: u, sectionId: w[M], eventNode: D[M] };
80 m.push(_(k));
81 }
82 }
83 return m;
84 }(d);
85 break;
86 default:
87 h = function(p) {
88 const { event: m, layout: g, viewName: c, sectionId: u } = p;
89 let f = [], y = e.$container.querySelectorAll(`[${e.config.event_attribute}='${m.id}']:not(.dhx_cal_select_menu):not(.dhx_drag_marker)`);
90 if (y)
91 for (let w = 0; w < y.length; w++) {
92 let D = y[w].cloneNode(!0);
93 const M = { event: { start_date: /* @__PURE__ */ new Date(+D.getAttribute("data-bar-start")), end_date: /* @__PURE__ */ new Date(+D.getAttribute("data-bar-end")) }, layout: g, viewName: c, sectionId: u, eventNode: D };
94 f.push(_(M));
95 }
96 return f;
97 }(d);
98 }
99 h.forEach((p) => {
100 i.push(e.markTimespan(p));
101 });
102 }

Callers 11

MtFunction · 0.70
_Function · 0.70
VtFunction · 0.70
dFunction · 0.70
lFunction · 0.70
hFunction · 0.70
ktFunction · 0.70
sFunction · 0.70
oFunction · 0.70
AFunction · 0.70

Calls 15

_Function · 0.70
iFunction · 0.70
oFunction · 0.70
nFunction · 0.70
aFunction · 0.70
pFunction · 0.70
week_startMethod · 0.65
addMethod · 0.65
getViewMethod · 0.65
markTimespanMethod · 0.65
callEventMethod · 0.65
uidMethod · 0.65

Tested by

no test coverage detected