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

Function buildPoslist

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

Source from the content-addressed store, hash-verified

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