");
d.appendTo(c);
const l = this.options.dayNames.length;
for (let e = 0; e < l; e++) {
var h = e + gcObject.options.dayBegin;
h >= l && (h -= l);
const t = gcObject.options.dayNames[h];
$('
' + t + "
").appendTo(d)
}
var r = $("");
r.appendTo(i);
const p = this.getCalendarArray(),
g = new Date;
p.forEach((function (e) {
var t = $("
");
e.forEach((function (e) {
var n = $('
');
n.appendTo(t);
var a = $('');
n.append(a), a.click((function (t) {
gcObject.options.onclickDate(t, e)
}));
var o = $(`${e.date}`);
n.addClass(e.class), o.appendTo(a), g.getFullYear() == e.datejs.getFullYear() && g.getMonth() == e.datejs.getMonth() && g.getDate() == e.datejs.getDate() && a.addClass("today");
var s = "";
gcObject.options.events.forEach((function (t) {
if (t.date.getFullYear() == e.datejs.getFullYear() && t.date.getMonth() == e.datejs.getMonth() && t.date.getDate() == e.datejs.getDate()) {
n.addClass("event");
var a = $(`
${t.eventName}
`);
s = "color:" + (t.dateColor || "inherit"), a.on("click", (function (e) {
t.onclick(e, t)
})), n.append(a)
}
})), o.attr("style", s)
})), t.appendTo(r)
}))
},
getCalendarArray() {
var e = new Date(this.pickedDate.getFullYear(), this.pickedDate.getMonth(), 1).getDay(),
t = new Date(this.pickedDate.getFullYear(), this.pickedDate.getMonth() + 1, 0).getDate(),
n = new Date(this.pickedDate.getFullYear(), this.pickedDate.getMonth(), 0).getDate(),
a = [],
o = e - gcObject.options.dayBegin;
o < 0 && (o = 7 + o);
for (let e = 0; e < o; e++) a.push({
datejs: new Date(this.pickedDate.getFullYear(), this.pickedDate.getMonth() - 1, n),
date: n,
class: "prev-month"
}), n--;
a.reverse();
var s = 1;
for (let e = a.length; e < 7; e++) a.push({
datejs: new Date(this.pickedDate.getFullYear(), this.pickedDate.getMonth(), s),
date: s,
class: "current-month"
}), s++;
var i = [a],
c = !1,
d = this.pickedDate,
l = "current-month";
for (let e = 1; e < 6; e++) {
var h = [];
for (let e = 0; e < 7; e++) h.push({
datejs: new Date(d.getFullYear(), d.getMonth(), s),
date: s,
class: l
}), ++s > t && (s = 1, d.setDate(1), d.setMonth(d.getMonth() + 1), c = !0, l = "next-month");
if (i.push(h), c) break
}
return i
}
};
jQuery.fn.calendarGC = function (e = {
dayNames: dayNames,
dayBegin: dayBegin,
monthNames: monthNames,
onPrevMonth: onPrevMonth,
onNextMonth: onNextMonth,
events: events,
onclickDate: onclickDate,
nextIcon: ">",
prevIcon: "<"
}) {
return gcObject.options.dayNames = e.dayNames || ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], gcObject.options.dayBegin = void 0 === e.dayBegin || null === e.dayBegin ? 1 : e.dayBegin, gcObject.options.monthNames = e.monthNames || ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], gcObject.options.onPrevMonth = e.onPrevMonth || function (e) {}, gcObject.options.onNextMonth = e.onNextMonth || function (e) {}, gcObject.options.events = e.events || [], gcObject.options.onclickDate = e.onclickDate || function (e, t) {}, gcObject.options.nextIcon = e.nextIcon || ">", gcObject.options.prevIcon = e.prevIcon || "<", gcObject.el = this, gcObject.render(), gcObject
};