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

Function buildPoslist

codebase/sources/dhtmlxscheduler.js:17630–17664  ·  view source on GitHub ↗
(bysetpos, timeset, start, end, ii, dayset)

Source from the content-addressed store, hash-verified

17628 return Iterinfo2;
17629 }();
17630 function buildPoslist(bysetpos, timeset, start, end, ii, dayset) {
17631 var poslist = [];
17632 for (var j = 0; j < bysetpos.length; j++) {
17633 var daypos = void 0;
17634 var timepos = void 0;
17635 var pos = bysetpos[j];
17636 if (pos < 0) {
17637 daypos = Math.floor(pos / timeset.length);
17638 timepos = pymod(pos, timeset.length);
17639 } else {
17640 daypos = Math.floor((pos - 1) / timeset.length);
17641 timepos = pymod(pos - 1, timeset.length);
17642 }
17643 var tmp = [];
17644 for (var k = start; k < end; k++) {
17645 var val = dayset[k];
17646 if (!isPresent(val))
17647 continue;
17648 tmp.push(val);
17649 }
17650 var i = void 0;
17651 if (daypos < 0) {
17652 i = tmp.slice(daypos)[0];
17653 } else {
17654 i = tmp[daypos];
17655 }
17656 var time = timeset[timepos];
17657 var date = fromOrdinal(ii.yearordinal + i);
17658 var res = combine(date, time);
17659 if (!includes(poslist, res))
17660 poslist.push(res);
17661 }
17662 sort(poslist);
17663 return poslist;
17664 }
17665 function iter(iterResult, options) {
17666 var dtstart = options.dtstart, freq = options.freq, interval = options.interval, until = options.until, bysetpos = options.bysetpos;
17667 var count = options.count;

Callers 1

iterFunction · 0.70

Calls 6

pymodFunction · 0.70
isPresentFunction · 0.70
fromOrdinalFunction · 0.70
combineFunction · 0.70
includesFunction · 0.70
sortFunction · 0.70

Tested by

no test coverage detected