[Vuejs]-Vue Fullcalender: Be able to have different prices on each day grid based on their day

0👍

Found solution thanks to ADyson
Here is the code for anyone that may need it in future.

            dayRender(dayRenderInfo) {
                const dayInfo = this.CalendarDays.filter(CalendarDay =>  moment(CalendarDay.day).isSame(dayRenderInfo.date, 'day'));

                if (dayInfo.length > 0) {
                    if (dayInfo[0].is_available === false) {
                        dayRenderInfo.el.innerHTML = "";
                        dayRenderInfo.el.classList.add("fc-past");
                    }
                    else {
                        dayRenderInfo.el.innerHTML = `
                        <div class="">
                            <span class="text-green-600 font-semibold day-price">$${dayInfo[0].price}</span>
                        </div>
                    `
                    }
                } else {
                    dayRenderInfo.el.innerHTML = `
                        <div class="">
                            <span class="text-green-600 font-semibold day-price">$${this.calendarPrice}</span>
                        </div>
                    `
                }
            },

Leave a comment