Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getDayView(events, viewDate, dayViewStart, dayViewEnd, dayViewSplit, dayViewEventWidth, dayViewSegmentSize) {
var dayStart = (dayViewStart || '00:00').split(':');
var dayEnd = (dayViewEnd || '23:59').split(':');
var view = calendarUtils.getDayView({
events: events.map(function(event) { // hack required to work with event API
var eventPeriod = getRecurringEventPeriod({
start: moment(event.startsAt),
end: moment(event.endsAt || event.startsAt)
}, event.recursOn, moment(viewDate).startOf('day'));
return updateEventForCalendarUtils(event, eventPeriod);
}),
viewDate: viewDate,
hourSegments: 60 / dayViewSplit,
dayStart: {
hour: dayStart[0],
minute: dayStart[1]
},
dayEnd: {
hour: dayEnd[0],
minute: dayEnd[1]