diff --git a/assets/js/utils/calendar_default_view.js b/assets/js/utils/calendar_default_view.js index 5b816442..9c149431 100755 --- a/assets/js/utils/calendar_default_view.js +++ b/assets/js/utils/calendar_default_view.js @@ -1098,14 +1098,27 @@ App.Utils.CalendarDefaultView = (function () { // Add appointments to calendar. response.appointments.forEach((appointment) => { + const title = [ + appointment.service.name + ]; + + const customerInfo = []; + + if (appointment.customer.first_name) { + customerInfo.push(appointment.customer.first_name); + } + + if (appointment.customer.last_name) { + customerInfo.push(appointment.customer.last_name); + } + + if (customerInfo.length) { + title.push(customerInfo.join(' ')); + } + const appointmentEvent = { id: appointment.id, - title: - appointment.service.name + - ' - ' + - appointment.customer.first_name + - ' ' + - appointment.customer.last_name, + title: title.join(' - '), start: moment(appointment.start_datetime).toDate(), end: moment(appointment.end_datetime).toDate(), allDay: false, diff --git a/assets/js/utils/calendar_table_view.js b/assets/js/utils/calendar_table_view.js index f798c8c5..c1a50778 100755 --- a/assets/js/utils/calendar_table_view.js +++ b/assets/js/utils/calendar_table_view.js @@ -969,14 +969,27 @@ App.Utils.CalendarTableView = (function () { continue; } + const title = [ + appointment.service.name + ]; + + const customerInfo = []; + + if (appointment.customer.first_name) { + customerInfo.push(appointment.customer.first_name); + } + + if (appointment.customer.last_name) { + customerInfo.push(appointment.customer.last_name); + } + + if (customerInfo.length) { + title.push(customerInfo.join(' ')); + } + calendarEvents.push({ id: appointment.id, - title: - appointment.service.name + - ' - ' + - appointment.customer.first_name + - ' ' + - appointment.customer.last_name, + title: title.join(' - '), start: moment(appointment.start_datetime).toDate(), end: moment(appointment.end_datetime).toDate(), allDay: false,