Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
uvarov-frontend committed Dec 6, 2023
1 parent 65925c9 commit 0e26866
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions examples/action-handlers-change-of-time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const options: Options = {
},
},
actions: {
changeTime(event, time, hours, minutes, keeping) {
console.log(time);
changeTime(event, self) {
console.log(self.selectedTime);
},
},
};
Expand Down
4 changes: 2 additions & 2 deletions examples/action-handlers-click-a-day-ranged.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const options: Options = {
},
},
actions: {
clickDay(event, dates) {
console.log(dates);
clickDay(event, self) {
console.log(self.selectedDates);
},
},
};
Expand Down
4 changes: 2 additions & 2 deletions examples/action-handlers-click-a-day.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import 'vanilla-calendar-pro/build/vanilla-calendar.min.css';

const options: Options = {
actions: {
clickDay(event, dates) {
console.log(dates);
clickDay(event, self) {
console.log(self.selectedDates);
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import 'vanilla-calendar-pro/build/vanilla-calendar.min.css';
const options: Options = {
type: 'month',
actions: {
clickMonth(e, month) {
console.log(month);
clickMonth(e, self) {
console.log(self.selectedMonth);
},
},
};
Expand Down
4 changes: 2 additions & 2 deletions examples/action-handlers-click-on-the-arrows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import 'vanilla-calendar-pro/build/vanilla-calendar.min.css';

const options: Options = {
actions: {
clickArrow(event, year, month) {
console.log(year, month);
clickArrow(event, self) {
console.log(self.selectedYear, self.selectedMonth);
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const options: Options = {
},
},
actions: {
clickWeekNumber(event, number, days, year) {
clickWeekNumber(event, number, days, year, self) {
calendar.settings.selected.dates = days.map((day) => day.dataset.calendarDay);
calendar.update();
},
Expand Down
2 changes: 1 addition & 1 deletion examples/action-handlers-click-on-the-week-number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const options: Options = {
},
},
actions: {
clickWeekNumber(event, number, days, year) {
clickWeekNumber(event, number, days, year, self) {
console.log(`Week number: ${number}`);
console.log(`Year of the week: ${year}`);
console.log('Days of this week:', days);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import 'vanilla-calendar-pro/build/vanilla-calendar.min.css';
const options: Options = {
type: 'year',
actions: {
clickYear(event, year) {
console.log(year);
clickYear(event, self) {
console.log(self.selectedYear);
},
},
};
Expand Down
2 changes: 1 addition & 1 deletion examples/action-handlers-get-and-change-every-day.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'vanilla-calendar-pro/build/vanilla-calendar.min.css';

const options: Options = {
actions: {
getDays(day, date, HTMLElement, HTMLButtonElement) {
getDays(day, date, HTMLElement, HTMLButtonElement, self) {
const randomBoolean = Math.random() < 0.5;
if (!randomBoolean) return;
const randomPrice = Math.floor(Math.random() * (999 - 100 + 1) + 100);
Expand Down

0 comments on commit 0e26866

Please sign in to comment.