1 function lookup(array, prop, value) {
\r
2 for (var i = 0, len = array.length; i < len; i++)
\r
3 if (array[i][prop] === value) return array[i];
\r
6 function GetTimeFromInt(intTime) {
\r
7 var has30 = intTime % 1;
\r
8 var CurInt = parseInt(intTime / 1);
\r
10 CurInt = "0" + CurInt;
\r
13 return CurInt + ":00";
\r
15 return CurInt + ":30";
\r
19 function fixOddEvenClasses() {
\r
20 $('#' + rsvrTblNm + ' tbody tr').removeClass();
\r
21 $('#' + rsvrTblNm + ' tbody tr:visible:even').addClass('even');
\r
22 $('#' + rsvrTblNm + ' tbody tr:visible:odd').addClass('odd');
\r
32 function schedulerIsRightClick(e) {
\r
34 return (e.which == 3);
\r
35 } else if (e.button) {
\r
36 return (e.button == 2);
\r
41 function schedulerCloneArray(originalArray) {
\r
42 var clonedArray = $.map(originalArray, function (obj) {
\r
43 return $.extend(true, {}, obj);
\r
49 function schedulerGetSlots(slotSpan) {
\r
50 if (slotSpan == 0) slotSpan = 10;
\r
52 var d = new Date(2014, 1, 1, 0, 0, 0, 0);
\r
54 while (d.getDate() == 1) {
\r
55 var tmpTime = schedulerPadStr(d.getHours()) + ':' + schedulerPadStr(d.getMinutes());
\r
56 slots.push({ id: i, time: tmpTime });
\r
57 d = schedulerAddMinutes(d, slotSpan);
\r
63 function schedulerGetLeases(slotSpan) {
\r
64 if (slotSpan == 0) slotSpan = 10;
\r
66 var d = new Date(2014, 1, 1, 0, 0, 0, 0);
\r
68 while (d.getDate() == 1) {
\r
69 //var tmpTime = schedulerPadStr(d.getHours()) + schedulerPadStr(d.getMinutes());
\r
70 slots.push({ id: i, status: getRandomStatus() });
\r
71 d = schedulerAddMinutes(d, slotSpan);
\r
77 function getRandomStatus() {
\r
78 var randint = Math.floor(Math.random() * (10 - 0 + 1) + 0);
\r
80 case 0: case 1: case 2: case 3: case 4: case 5: case 6: return "free";
\r
81 //case 8: return "selected";
\r
82 case 7: case 8: case 9: return "reserved";
\r
83 case 10: return "maintenance";
\r
87 function schedulerPadStr(i) {
\r
88 return (i < 10) ? "0" + i : "" + i;
\r
91 function schedulerAddMinutes(date, minutes) {
\r
92 return new Date(date.getTime() + minutes * 60000);
\r