PageSourceSearch

https://air-loyaute.nc/scripts/general/packageSearch.js

js air-loyaute.nc collected 2026-10-02 21:38:46 UTC 24,092 bytes, 770 lines download raw bytes

1var packageDSTS = [];
2
3function searchPkg() {
4  var fullCalendar;
5  var dates = { y: 0, m: 0 };
6  var dates2 = { y: 0, m: 0 };
7  var monthCalendarPkg = cloneElement("dateFrame_month_pkg", 0);
8  var monthCalendarPkg2 = cloneElement("dateFrame_month_pkg2", 0);
9  var dayli = $(".dayLi");
10  var availableDays;
11  if ($(".pkgEngine").length > 0) {
12    /* style */
13    //set default value
14    $(".pkgEngine .selectfiled input").val(
15      $(".pkgEngine .selectfiled li div").first().html()
16    );
17    $(".pkgEngine .selectfiled input").attr("data-style-val", 0);
18    $(".pkgEngine .selectfiled label[for=style]").addClass("filled");
19
20    //close all other popups when style input on focus
21    $(".pkgEngine .selectfiled input").on("focus", function () {
22      closeDates_pkg();
23      closeDays();
24      $(this)
25        .siblings(".stylesHolder")
26        .find("ul")
27        .slideDown()
28        .promise()
29        .done(function () {
30          $(this).css("display", "block");
31        });
32    });
33
34    $(".pkgEngine .selectfiled .stylesHolder ul li").on("click", function (e) {
35      e.preventDefault();
36      $(this)
37        .parents(".stylesHolder")
38        .siblings("input")
39        .val($(this).find("div").html());
40      $(this)
41        .parents(".stylesHolder")
42        .siblings("input")
43        .attr("data-style-val", $(this).find("div").attr("data-style-val"));
44      closeStyle();
45
46      var styleid = $(this).find("div").attr("data-style-val");
47      callController(
48        "packages",
49        "pkgEngineData",
50        "?action=destinationsFilter&styleid=" + styleid.toString(),
51        false,
52        false,
53        function (destinations) {
54          destinations = JSON.parse(destinations);
55          packageDSTS = destinations;
56          fromAutoCompletePkg(destinations);
57        }
58      );
59      callDaysController();
60    });
61
62    $(".pkgEngine .selectfiled .stylesHolder ul li").hover(function () {
63      $(this).parent().find(".selected").removeClass("selected");
64      $(this).addClass("selected");
65    });
66
67    function closeStyle() {
68      if ($(".pkgEngine .stylesHolder").find("ul").css("display") == "none")
69        return;
70      $(".pkgEngine .stylesHolder")
71        .find("ul")
72        .slideUp()
73        .promise()
74        .done(function () {
75          $(this).css("display", "none");
76        });
77    }
78
79    /* destinations */
80    callController(
81      "packages",
82      "pkgEngineData",
83      "?action=destinations",
84      false,
85      false,
86      function (destinations) {
87        destinations = JSON.parse(destinations);
88        packageDSTS = destinations;
89        fromAutoCompletePkg(destinations);
90      }
91    );
92
93    function fromAutoCompletePkg(destinations) {
94      $("#flightFromPkg").val("");
95      $(".pkgEngine .pkgDestinations label[for=flightFromPkg]").removeClass(
96        "filled"
97      );
98      var self = $("#flightFromPkg");
99      self.on("focus", function () {
100        $(this).parents("label").addClass("focused");
101        closeDates_pkg();
102        closeStyle();
103        closeDays();
104        var e = jQuery.Event("keyup");
105        e.which = 0; //choose the one you want
106        e.keyCode = 0;
107        var value = $(this).val() !== "" ? $(this).val() : "";
108        $(this).val(value).trigger(e);
109        $(this).parents("label").addClass("focused");
110      });
111      self.easyAutocomplete({
112        data: destinations,
113        getValue: "name",
114        list: {
115          maxNumberOfElements: 100,
116          onShowListEvent: function () {
117            self.parents("label").addClass("focused");
118          },
119          onHideListEvent: function () {
120            if (self.val() != "") self.parents("label").addClass("filled");
121          },
122          match: { enabled: true },
123        },
124      });
125    }
126
127    $(".flightForm li label input").on("change", function () {
128      if ($(this).val() == " ") {
129        $(this).val("");
130      }
131    });
132
133    $(".pkgDestinations input").on("change", function () {
134      callDaysController();
135    });
136
137    /* days */
138    $("#flightForm_daysNumber_pkg").on("focus", function () {
139      closeDates_pkg();
140      closeStyle();
141
142      $(this)
143        .siblings(".daysHolder")
144        .find("ul")
145        .slideDown()
146        .promise()
147        .done(function () {
148          $(this).css("display", "block");
149        });
150    });
151
152    callController(
153      "packages",
154      "pkgEngineData",
155      "?action=days",
156      false,
157      false,
158      function (days) {
159        var days = JSON.parse(days);
160        insertDaysOptions(days);
161      }
162    );
163
164    function insertDaysOptions(days) {
165      $(".dayLiHolder").empty();
166      dayli.appendTo(".dayLiHolder");
167      $("#flightForm_daysNumber_pkg").val(dayli.find(".daysNumber").html());
168      days.forEach(function (element) {
169        var clone = dayli.clone();
170        clone.find(".daysNumber").html(element);
171        clone.find(".eac-item").attr("data-day-val", element);
172        clone.find(".daysText").css("display", "inline-block");
173        clone.appendTo(".dayLiHolder");
174      });
175      $(".pkgEngine .daysHolder .dayLiHolder li").on("click", function (e) {
176        e.preventDefault();
177        $(this)
178          .parents(".daysHolder")
179          .siblings("input")
180          .attr("data-day-val", $(this).find(".eac-item").attr("data-day-val"));
181        var thisValue =
182          parseInt($(this).find(".daysNumber").html()) == 0
183            ? dayli.val()
184            : $(this).find(".daysNumber").html();
185        $(this).parents(".daysHolder").siblings("input").val(thisValue);
186        closeDays();
187      });
188    }
189
190    function closeDays() {
191      $(".dayLiHolder")
192        .slideUp()
193        .promise()
194        .done(function () {
195          $(this).css("display", "none");
196        });
197    }
198
199    function callDaysController() {
200      var styleid = $(".pkgEngine .selectfiled input").attr("data-style-val");
201      var dstid =
202        getDSTcodeByNameForPKG($("#flightFromPkg").val()) == ""
203          ? 0
204          : getDSTcodeByNameForPKG($("#flightFromPkg").val());
205
206      callController(
207        "packages",
208        "pkgEngineData",
209        "?action=daysFilter&styleid=" + styleid + "&dstid=" + dstid,
210        false,
211        false,
212        function (days) {
213          var days = JSON.parse(days);
214          insertDaysOptions(days);
215        }
216      );
217    }
218
219    /* dates */
220    //open calendar popup
221    $(document).on("focus", "#flightDepart_pkg", function () {
222      closeStyle();
223      closeDays();
224      $("#flightForm_datePop_pkg")
225        .slideDown()
226        .promise()
227        .done(function () {
228          $(this).attr("aria-hidden", "false");
229        });
230    });
231
232    $(document).on("focus", "#flightDepart_pkg2", function () {
233      $("#flightForm_datePop_pkg2")
234        .slideDown()
235        .promise()
236        .done(function () {
237          $(this).attr("aria-hidden", "false");
238          $(this).parent(".flightForm_dateHolder").css("position", "relative");
239        });
240    });
241
242    //close calendar popup
243    function closeDates_pkg() {
244      $("#flightForm_datePop_pkg")
245        .slideUp()
246        .promise()
247        .done(function () {
248          $(this).attr("aria-hidden", "true");
249        });
250      $("#flightForm_datePop_pkg2")
251        .slideUp()
252        .promise()
253        .done(function () {
254          $(this).attr("aria-hidden", "true");
255        });
256    }
257
258    //close calendar X button
259    $(".flightForm_dateClose_pkg").on("click", function (e) {
260      e.preventDefault();
261      closeDates_pkg();
262    });
263
264    addLoader(document.getElementById("dateFrame_pkg"), false);
265    if ($("#flightForm_datePop_pkg2").length > 0)
266      addLoader(document.getElementById("dateFrame_pkg2"), false);
267
268    //get calendar data from controller
269    callController(
270      "packages",
271      "packageBookCalendar",
272      false,
273      "",
274      false,
275      function (data) {
276        calendarData = JSON.parse(copyObj(data));
277        fullCalendar = calendarData.calendar;
278        availableDays = calendarData.days;
279        var nextThreeDays = new Date().addDays(3);
280        var startDate = new Date();
281        if (nextThreeDays.getMonth() > new Date().getMonth())
282          startDate.setMonth(startDate.getMonth() + 1);
283        if ($("#flightForm_datePop_pkg").length > 0) {
284          dates.y = startDate.getFullYear();
285          dates.m = startDate.getMonth();
286          document.getElementById("dateFrame_pkg").innerHTML = "";
287          getCalendar(fullCalendar, dates, "dateFrame_pkg");
288        }
289        if ($("#flightForm_datePop_pkg2").length > 0) {
290          dates2.y = startDate.getFullYear();
291          dates2.m = startDate.getMonth();
292          document.getElementById("dateFrame_pkg2").innerHTML = "";
293          getCalendar(fullCalendar, dates2, "dateFrame_pkg2");
294        }
295      }
296    );
297
298    Date.prototype.addDays = function (days) {
299      var date = new Date(this.valueOf());
300      date.setDate(date.getDate() + days);
301      return date;
302    };
303
304    //next month
305    $(document).on(
306      "click",
307      "#flightForm_datePop_pkg .flightForm_dateNextMonth, #flightForm_datePop_pkg2 .flightForm_dateNextMonth",
308      function (e) {
309        e.preventDefault();
310        $(this).siblings(".flightForm_datePrevMonth").removeClass("disabled");
311        $(this)
312          .siblings(".flightForm_datePrevMonth")
313          .css("pointer-events", "auto");
314        var localDates;
315        if ($(this).parents("#flightForm_datePop_pkg").length > 0) {
316          localDates = dates;
317          $("#dateFrame_pkg").empty();
318        } else {
319          localDates = dates2;
320          $("#dateFrame_pkg2").empty();
321        }
322        if (localDates.m > 11) {
323          localDates.m = 0;
324          localDates.y += 1;
325        }
326        dateFrame = $(this).siblings(".frameid").attr("id");
327        getCalendar(fullCalendar, localDates, dateFrame);
328      }
329    );
330
331    //previous month
332    $(document).on(
333      "click",
334      "#flightForm_datePop_pkg .flightForm_datePrevMonth, #flightForm_datePop_pkg2 .flightForm_datePrevMonth",
335      function (e) {
336        e.preventDefault();
337        var localDates;
338        if ($(this).parents("#flightForm_datePop_pkg").length > 0) {
339          localDates = dates;
340          $("#dateFrame_pkg").empty();
341        } else {
342          localDates = dates2;
343          $("#dateFrame_pkg2").empty();
344        }
345        localDates.m -= 2;
346        if (localDates.m < 0) {
347          localDates.m = localDates.m == -1 ? 11 : 10;
348          localDates.y -= 1;
349        }
350        if (localDates.m == new Date().getMonth()) {
351          $(this).addClass("disabled");
352          $(this).css("pointer-events", "none");
353        }
354        dateFrame = $(this).siblings(".frameid").attr("id");
355        getCalendar(fullCalendar, localDates, dateFrame);
356      }
357    );
358
359    //choose a date
360    $(document).on(
361      "click",
362      "#flightForm_datePop_pkg .dateFrame_calendar_pkg a, #flightForm_datePop_pkg2 .dateFrame_calendar_pkg2 a",
363      function (e) {
364        e.preventDefault();
365        if ($(this).hasClass("disabled")) {
366          return false;
367        }
368        $(".bookForm .dateInputPkg").css("background", "white");
369        showAeroLoader();
370        var dayx = $(this).find("strong").html();
371        if (dayx.length < 2) dayx = "0" + dayx;
372        var monthx = $(this).data().monthnumber;
373        var yearx = $(this).data().year;
374        var fromDate;
375        var toDate;
376
377        //$(this).closest('.flightForm_datePop').find('.flightForm_datePrevMonth').addClass('disabled');
378        $(this)
379          .parents(".monthPkg")
380          .parent()
381          .find("a")
382          .removeClass("pkg_selected");
383        $(this).addClass("pkg_selected");
384        var format = $(this)
385          .closest(".flightForm_dateHolder")
386          .siblings(".pkgEngine")
387          .find(".dateInputPkg")
388          .attr("data-dateformat");
389        format = format !== "" ? format : "DMY";
390        datesInput = $(this)
391          .closest(".flightForm_dateHolder")
392          .siblings(".pkgEngine")
393          .find(".dateInputPkg");
394        switch (format) {
395          case "YMD":
396            $(datesInput).val(yearx + "/" + monthx + "/" + dayx);
397            //$("#flightDepart_mobile").val(yearx+'/'+monthx+'/'+dayx);
398            break;
399          case "MDY":
400            $(datesInput).val(monthx + "/" + dayx + "/" + yearx);
401            //$("#flightDepart_mobile").val(monthx+'/'+dayx+'/'+yearx);
402            break;
403
404          default: //DMY
405            $(datesInput).val(dayx + "/" + monthx + "/" + yearx);
406            //$("#flightDepart_mobile").val(dayx+'/'+monthx+'/'+yearx);
407            break;
408        }
409        $(datesInput)
410          .parents("label")
411          .removeClass("focused")
412          .addClass("filled");
413        $(datesInput).attr("data-date-ymd", yearx + "/" + monthx + "/" + dayx);
414        $(datesInput).siblings(".removeDateChoice_pkg").css("display", "block");
415        closeDates_pkg();
416        hideAeroLoader();
417      }
418    );
419
420    $(".removeDateChoice_pkg").on("click", function (e) {
421      e.preventDefault();
422      $(this).siblings(".dateInputPkg").val("");
423      $(this).siblings(".dateInputPkg").attr("data-date-ymd", "");
424      $(this)
425        .siblings(".dateInputPkg")
426        .parents("label")
427        .removeClass("filled")
428        .removeClass("focused");
429      $(this).css("display", "none");
430      $(this)
431        .closest(".pkgEngine")
432        .siblings(".flightForm_dateHolder")
433        .find("a")
434        .removeClass("pkg_selected");
435    });
436
437    /* book adults,kids,infant */
438    if ($(".bookForm").length > 0) {
439      $(document).on("change", ".bookForm select", function () {
440        if ($(this).val() != "") {
441          $(this).parents("label").removeClass("focused").addClass("filled");
442        } else $(this).parents("label").removeClass("focused").removeClass("filled");
443      });
444    }
445
446    /* button */
447    $(document).on("click", '#pkgSubmit input[type="submit"]', function () {
448      var styleid =
449        $("#style").attr("data-style-val") == ""
450          ? 0
451          : $("#style").attr("data-style-val");
452      var dstid =
453        getDSTcodeByNameForPKG($("#flightFromPkg").val()) == ""
454          ? 0
455          : getDSTcodeByNameForPKG($("#flightFromPkg").val());
456      var departdate =
457        $("#flightDepart_pkg").val() == ""
458          ? null
459          : $("#flightDepart_pkg").val();
460      var numberofdays = parseInt(
461        $("#flightForm_daysNumber_pkg").attr("data-day-val")
462      );
463
464      if (departdate != null) {
465        var date = departdate.split("/");
466        departdate = [date[2], date[1], date[0]].join("-");
467      }
468      showLoader();
469      window.top.location.href =
470        $("#homeUrl").val() +
471        "/packages/" +
472        styleid +
473        "/" +
474        dstid +
475        "/" +
476        numberofdays +
477        "/" +
478        departdate;
479    });
480  }
481
482  function translateMonth(calendar) {
483    var monthList = JSON.parse($("#monthsArray").val());
484    var currentMonth = $(calendar)
485      .find(".dateFrame_title")
486      .text()
487      .trim()
488      .split(" ")[0];
489    switch (currentMonth) {
490      case "JANUARY":
491        newText = $(calendar)
492          .find(".dateFrame_title")
493          .text()
494          .replace("JANUARY", monthList[0]["monthDisplayFull"]);
495        $(calendar).find(".dateFrame_title").text(newText);
496        break;
497      case "FEBRUARY":
498        newText = $(calendar)
499          .find(".dateFrame_title")
500          .text()
501          .replace("FEBRUARY", monthList[1]["monthDisplayFull"]);
502        $(calendar).find(".dateFrame_title").text(newText);
503        break;
504      case "MARCH":
505        newText = $(calendar)
506          .find(".dateFrame_title")
507          .text()
508          .replace("MARCH", monthList[2]["monthDisplayFull"]);
509        $(calendar).find(".dateFrame_title").text(newText);
510        break;
511      case "APRIL":
512        newText = $(calendar)
513          .find(".dateFrame_title")
514          .text()
515          .replace("APRIL", monthList[3]["monthDisplayFull"]);
516        $(calendar).find(".dateFrame_title").text(newText);
517        break;
518      case "MAY":
519        newText = $(calendar)
520          .find(".dateFrame_title")
521          .text()
522          .replace("MAY", monthList[4]["monthDisplayFull"]);
523        $(calendar).find(".dateFrame_title").text(newText);
524        break;
525      case "JUNE":
526        newText = $(calendar)
527          .find(".dateFrame_title")
528          .text()
529          .replace("JUNE", monthList[5]["monthDisplayFull"]);
530        $(calendar).find(".dateFrame_title").text(newText);
531        break;
532      case "JULY":
533        newText = $(calendar)
534          .find(".dateFrame_title")
535          .text()
536          .replace("JULY", monthList[6]["monthDisplayFull"]);
537        $(calendar).find(".dateFrame_title").text(newText);
538        break;
539      case "AUGUST":
540        newText = $(calendar)
541          .find(".dateFrame_title")
542          .text()
543          .replace("AUGUST", monthList[7]["monthDisplayFull"]);
544        $(calendar).find(".dateFrame_title").text(newText);
545        break;
546      case "SEPTEMBER":
547        newText = $(calendar)
548          .find(".dateFrame_title")
549          .text()
550          .replace("SEPTEMBER", monthList[8]["monthDisplayFull"]);
551        $(calendar).find(".dateFrame_title").text(newText);
552        break;
553      case "OCTOBER":
554        newText = $(calendar)
555          .find(".dateFrame_title")
556          .text()
557          .replace("OCTOBER", monthList[9]["monthDisplayFull"]);
558        $(calendar).find(".dateFrame_title").text(newText);
559        break;
560      case "NOVEMBER":
561        newText = $(calendar)
562          .find(".dateFrame_title")
563          .text()
564          .replace("NOVEMBER", monthList[10]["monthDisplayFull"]);
565        $(calendar).find(".dateFrame_title").text(newText);
566        break;
567      case "DECEMBER":
568        newText = $(calendar)
569          .find(".dateFrame_title")
570          .text()
571          .replace("DECEMBER", monthList[11]["monthDisplayFull"]);
572        $(calendar).find(".dateFrame_title").text(newText);
573        break;
574      default:
575    }
576  }
577
578  //check if a day is in on the pricing range of the package and if this pricing is available for this day of the week
579  function validDay(date, clendarElementId) {
580    if (availableDays == undefined || clendarElementId == "dateFrame_pkg")
581      return true;
582
583    flag = false;
584
585    availableDays.forEach(function (days) {
586      start = new Date(days.fromdate);
587      end = new Date(days.todate);
588      start.setHours(0, 0, 0, 0);
589      end.setHours(0, 0, 0, 0);
590
591      //if day is in pricing range
592      if (
593        date.getTime() <= end.getTime() &&
594        date.getTime() >= start.getTime()
595      ) {
596        //and if its available on this day of the week
597        if (days["day" + (date.getDay() + 1).toString()]) flag = true;
598      }
599    });
600
601    return flag;
602  }
603
604  function getCalendar(calendardata, yearMonth, dateFarmeId) {
605    var monthBox =
606      dateFarmeId == "dateFrame_pkg" ? monthCalendarPkg : monthCalendarPkg2;
607    var datesClass =
608      dateFarmeId == "dateFrame_pkg"
609        ? "dateFrame_calendar_pkg"
610        : "dateFrame_calendar_pkg2";
611    var calendar = injectHTML(
612      calendardata[yearMonth.y.toString()]["months"][yearMonth.m],
613      monthBox,
614      dateFarmeId,
615      Number(0)
616    );
617    translateMonth(calendar);
618    var children = injectChildren(
619      calendardata[yearMonth.y.toString()]["months"][yearMonth.m].days,
620      calendar,
621      datesClass,
622      dateFarmeId,
623      Number(0),
624      true
625    );
626
627    $(children)
628      .find("a")
629      .each(function (key) {
630        var date = new Date(
631          $(this).attr("data-year"),
632          $(this).attr("data-monthnumber") - 1,
633          parseInt($(this).attr("data-daynumber"))
634        );
635        var today = new Date();
636        today.setHours(0, 0, 0, 0);
637        today = today.addDays(3);
638        if (date < today || !validDay(date, dateFarmeId))
639          $(this).addClass("disabled");
640      });
641
642    yearMonth.m++;
643    if (yearMonth.m > 11) {
644      yearMonth.m = 0;
645      yearMonth.y++;
646    }
647    var calendar = injectHTML(
648      calendardata[yearMonth.y.toString()]["months"][yearMonth.m],
649      monthBox,
650      dateFarmeId,
651      0
652    );
653    translateMonth(calendar);
654    var nextMonthChildren = injectChildren(
655      calendardata[yearMonth.y.toString()]["months"][yearMonth.m].days,
656      calendar,
657      datesClass,
658      dateFarmeId,
659      Number(1),
660      true
661    );
662
663    $(nextMonthChildren)
664      .find("a")
665      .each(function (key) {
666        var date = new Date(
667          $(this).attr("data-year"),
668          $(this).attr("data-monthnumber") - 1,
669          parseInt($(this).attr("data-daynumber"))
670        );
671        if (!validDay(date, dateFarmeId)) $(this).addClass("disabled");
672      });
673
674    var li = "<li><div>&nbsp;</div></li>";
675    $("#" + dateFarmeId + " ." + datesClass).each(function (key) {
676      var date = new Date(
677        $(this).find("li").first().find("a").attr("data-year"),
678        $(this).find("li").first().find("a").attr("data-monthnumber") - 1,
679        $(this).find("li").first().find("a").attr("data-daynumber")
680      );
681
682      var mondayFirst = $("#companycalendarmonday").val() === "true";
683      var dayOfWeek = date.getDay(); // 0=Sunday, 1=Monday, ..., 6=Saturday
684      var isRTL = $("body").attr("dir") === "rtl";
685      var emptyDays = 0;
686
687      if (mondayFirst) {
688        // Monday first: adjust Sunday (0) to be 7, then subtract 1
689        emptyDays = dayOfWeek === 0 ? 6 : dayOfWeek - 1;
690      } else {
691        // Sunday first: use dayOfWeek directly
692        emptyDays = dayOfWeek;
693      }
694
695      // RTL: In RTL layouts, the CSS visually reverses the grid columns
696      // The DOM structure remains the same, but visual position is flipped
697      if (isRTL) {
698        // In RTL, we need to think about where the day should appear visually,
699        // then calculate the DOM position that will result in that visual position
700        var visualPosition;
701
702        if (mondayFirst) {
703          // Monday-first: Mon=0, Tue=1, Wed=2, Thu=3, Fri=4, Sat=5, Sun=6
704          visualPosition = dayOfWeek === 0 ? 6 : dayOfWeek - 1;
705        } else {
706          // Sunday-first: Sun=0, Mon=1, Tue=2, Wed=3, Thu=4, Fri=5, Sat=6
707          visualPosition = dayOfWeek;
708        }
709
710        // In RTL CSS, visual position 0 (leftmost) corresponds to DOM position 6
711        // Visual position 1 corresponds to DOM position 5, etc.
712        emptyDays = 6 - visualPosition;
713      }
714
715      for (var j = 0; j < emptyDays; j++) {
716        $(this).prepend(li);
717      }
718
719      var date = new Date(
720        $(this).find("li").last().find("a").attr("data-year"),
721        $(this).find("li").last().find("a").attr("data-monthnumber") - 1,
722        $(this).find("li").last().find("a").attr("data-daynumber")
723      );
724
725      // Consistent end-of-month padding
726      var lastDayOfWeek = date.getDay();
727      var paddingDays = 0;
728
729      if (mondayFirst) {
730        // Monday first: Sunday (0) should have no padding, other days need padding
731        paddingDays = lastDayOfWeek === 0 ? 0 : 7 - lastDayOfWeek;
732      } else {
733        // Sunday first: Saturday (6) should have no padding, other days need padding
734        paddingDays = lastDayOfWeek === 6 ? 0 : 6 - lastDayOfWeek;
735      }
736
737      // RTL: End-of-month padding also needs to be adjusted for RTL layouts
738      if (isRTL && paddingDays > 0) {
739        // In RTL, the visual layout is reversed, so padding calculation needs adjustment
740        if (mondayFirst) {
741          // RTL Monday-first: Calculate padding from the visual perspective
742          paddingDays = lastDayOfWeek === 0 ? 0 : 7 - lastDayOfWeek;
743        } else {
744          // RTL Sunday-first: Calculate padding from the visual perspective
745          paddingDays = lastDayOfWeek === 6 ? 0 : 6 - lastDayOfWeek;
746        }
747      }
748
749      for (var j = 0; j < paddingDays; j++) {
750        $(this).append(li);
751      }
752    });
753  }
754}
755
756function getDSTcodeByNameForPKG(name) {
757  var result = "";
758  packageDSTS.forEach(function (dst) {
759    if ($.trim(dst.name) === $.trim(name)) {
760      result = dst.code;
761    }
762  });
763  return result;
764}
765
766$(document).ready(function () {
767  if ($(".dateFrame_month_pkg")) {
768    searchPkg();
769  }
770});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.