Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Guf-Hub committed Aug 1, 2023
1 parent 8964901 commit 8710b7d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bot/1.4 Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class Calendar {
this.language = language || "ru";
this.weekDays = configCalendar.language[this.language].weeksDays;
this.namesOfMonths = configCalendar.language[this.language].months;
this.headerMonthYear = "";
this.header = "";
this.keyboard = new Keyboard();
this.key = new Key();
Expand All @@ -103,13 +104,14 @@ class Calendar {
const monthString = this.padNumber(this.month);
const calendar = [];

this.headerMonthYear = [`${this.namesOfMonths[monthString]} ${this.year}`];
this.header = [
["<<<", `PREV-MONTH:${this.previous()}`],
[`${this.namesOfMonths[monthString]} ${this.year}`, " "],
// [`${this.namesOfMonths[monthString]} ${this.year}`, " "],
[">>>", `NEXT-MONTH:${this.next()}`],
];

calendar.push(this.header, this.weekDays);
calendar.push(this.headerMonthYear, this.header, this.weekDays);

// let week = Array.from({ length: this.dayNumber(date) }, () => [""]);
let week = this.padding(this.dayNumber(date));
Expand Down Expand Up @@ -154,7 +156,7 @@ class Calendar {
el.map((e) =>
Number(e[0])
? this.key.callback(e[0], `DAY:${e[2]}-${e[1]}-${e[0]}`)
: this.weekDays.includes(e)
: this.weekDays.includes(e) || this.headerMonthYear.includes(e)
? this.key.callback(e, " ")
: this.header.includes(e)
? this.key.callback(e[0], e[1])
Expand Down

0 comments on commit 8710b7d

Please sign in to comment.