End time is not updated in time function
GeoffreyPorayko opened this issue · 0 comments
GeoffreyPorayko commented
Version
2.1.3
Test Environment
Google, windows
Current Behavior
I add on events title, start time and end time.
When I drag an event to drop it on another time slot, the start time updates every time I drag the event but the end time does not.
To replicate this behavior, all you need to do is create a base calendar, set the view to weekdays, and change the time return in the template property.
Link of by codepen: https://codepen.io/geoffreyporayko/pen/QWZOJVx
const Calendar = tui.Calendar;
const container = document.getElementById('calendar');
const options = {
defaultView: 'week',
template: {
time(schedule){
console.log(schedule)
return '<strong>' + moment(schedule.start.getTime()).format('HH:mm') +" - " + moment(schedule.end.getTime()).format('HH:mm') + '</strong> : ' + schedule.title;
},
},
useDetailPopup: true,
useFormPopup: false,
week: {
startDayOfWeek: 1,
narrowWeekend: false,
taskView: false,
eventView: ['time', 'allday']
},
timezone: {
zones: [
{
timezoneName: 'Europe/London',
displayLabel: 'London',
},
],
},
calendars: [
{
id: 'cal1',
name: 'Personal',
backgroundColor: '#03bd9e',
},
{
id: 'cal2',
name: 'Work',
backgroundColor: '#00a9ff',
},
],
};
const calendar = new Calendar(container, options);
calendar.createEvents([
{
id: 'event1',
calendarId: 'cal2',
title: 'Weekly meeting',
start: '2023-05-05T09:00:00',
end: '2023-05-05T10:00:00',
},
{
id: 'event2',
calendarId: 'cal1',
title: 'Lunch appointment',
start: '2022-06-08T12:00:00',
end: '2022-06-08T13:00:00',
},
{
id: 'event3',
calendarId: 'cal2',
title: 'Vacation',
start: '2022-06-08',
end: '2022-06-10',
isAllday: true,
category: 'allday',
},
]);