Skip to content

Commit 744b152

Browse files
authored
Scheduler: convert recurrence class to pure functions (#31054)
Co-authored-by: Vladimir Bushmanov <[email protected]>
1 parent c8e828e commit 744b152

File tree

22 files changed

+912
-895
lines changed

22 files changed

+912
-895
lines changed

packages/devextreme/js/__internal/scheduler/appointments/appointment/m_appointment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import {
2323
REDUCED_APPOINTMENT_ICON,
2424
REDUCED_APPOINTMENT_PARTS_CLASSES,
2525
} from '../../m_classes';
26-
import { getRecurrenceProcessor } from '../../m_recurrence';
2726
import type { SubscribeKey, SubscribeMethods } from '../../m_subscribes';
27+
import { validateRRule } from '../../recurrence/validate_rule';
2828
import type { AppointmentDataAccessor } from '../../utils/data_accessor/appointment_data_accessor';
2929
import type { AppointmentProperties } from './m_types';
3030
import {
@@ -270,7 +270,7 @@ export class Appointment extends DOMComponent<AppointmentProperties> {
270270
_renderRecurrenceClass() {
271271
const rule = this.dataAccessors.get('recurrenceRule', this.rawAppointment);
272272

273-
if (getRecurrenceProcessor().isValidRecurrenceRule(rule)) {
273+
if (validateRRule(rule)) {
274274
(this.$element() as any).addClass(RECURRENCE_APPOINTMENT_CLASS);
275275
}
276276
}

packages/devextreme/js/__internal/scheduler/appointments/m_appointment_collection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import { dateUtilsTs } from '@ts/core/utils/date';
2626

2727
import { APPOINTMENT_SETTINGS_KEY } from '../constants';
2828
import { APPOINTMENT_CONTENT_CLASSES, APPOINTMENT_DRAG_SOURCE_CLASS, APPOINTMENT_ITEM_CLASS } from '../m_classes';
29-
import { getRecurrenceProcessor } from '../m_recurrence';
3029
import timeZoneUtils from '../m_utils_time_zone';
30+
import { generateDates } from '../recurrence/generate_dates';
3131
import type { CompactAppointmentOptions } from '../types';
3232
import { AppointmentAdapter } from '../utils/appointment_adapter/appointment_adapter';
3333
import type { AppointmentDataAccessor } from '../utils/data_accessor/appointment_data_accessor';
@@ -1070,7 +1070,7 @@ class SchedulerAppointments extends CollectionWidget {
10701070

10711071
const timezoneCalculator = this.option('timeZoneCalculator');
10721072

1073-
const recurrentDates = getRecurrenceProcessor().generateDates({
1073+
const recurrentDates = generateDates({
10741074
rule: recurrenceRule,
10751075
exception: recurrenceException,
10761076
start: startDate,

packages/devextreme/js/__internal/scheduler/m_recurrence.pacific.test.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)