В fullcalendar.js есть функция renderSlatRowHtml
.
Я пытаюсь получить доступ в своем собственном файле машинописи угловых компонентов.
Ниже приведен код, к которому я пытаюсь получить доступ вот так
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
renderSlatRowHtml: function() {
let view = this.view;
let calendar = view.calendar;
let theme = calendar.theme;
let isRTL = this.isRTL;
let dateProfile = this.dateProfile;
let html = '';
let slotTime = moment.duration(+dateProfile.minTime); // wish there was .clone() for durations
let slotIterator = moment.duration(0);
let slotDate; // will be on the view's first day, but we only care about its time
let isLabeled;
let axisHtml;
// Calculate the time for each slot
while (slotTime < dateProfile.maxTime) {
slotDate = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.startMs).time(slotTime);
isLabeled = $('#calendar').isInt($('#calendar').divideDurationByDuration(slotIterator, this.labelInterval));
axisHtml =
'<td class="fc-axis fc-time' + theme.getClass('widgetContent testClass') + '" ' + view.axisStyleAttr() + '>' +
(isLabeled ?
'<span>' + // for matchCellWidths
FC.htmlEscape(slotDate.format(this.labelFormat)) +
'</span>' :
''
) +
'</td>';
html +=
'<tr test data-time="' + slotDate.format('HH:mm:ss') + '"' +
(isLabeled ? '' : ' class="fc-minor"') +
'>' +
(!isRTL ? axisHtml : '') +
'<td class="' + theme.getClass('widgetContent testClass') + '"/>' +
(isRTL ? axisHtml : '') +
'</tr>';
slotTime.add(this.slotDuration);
slotIterator.add(this.slotDuration);
}
return html;
}
})
Выше коды были скопированы из ядраfullcalendar.js.Я пытаюсь добавить некоторые пользовательские классы, такие как testClass
и т. Д., Но не работает.
Я использую Полная версия календаря: 3.6.2 .