Skip to content

Commit 819a55b

Browse files
Merge pull request #37 from DHTMLX/sp-next-v2.3.0
[update] Whats new and changes before release v2.3.0
2 parents ecf4d82 + fead25c commit 819a55b

File tree

8 files changed

+692
-23
lines changed

8 files changed

+692
-23
lines changed

docs/api/config/js_eventcalendar_config_config.md

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ config?: {
2525
eventsOverlay?: boolean,
2626
autoSave?: boolean,
2727
readonly?: boolean,
28+
highlightReadonly?: boolean,
2829
dimPastEvents?: boolean,
2930
dateClick?: boolean | string, // (true/false or "day" | "week" | "month" | "year" | "agenda" | "timeline")
3031
dateTitle?: (date, [start, end]) => string,
@@ -82,7 +83,7 @@ config?: {
8283
step?: array, // [number, "day" | "week" | "month" | "year" | "hour" | "minute"]
8384
header?: [
8485
{
85-
unit: string, // "year" | "month" | "quarter" | "month" | "week" | "day" | "hour" | "minute"
86+
unit: string, // "year" | "month" | "quarter" | "week" | "day" | "hour" | "minute"
8687
format: string, // date-fns format
8788
step: number
8889
},
@@ -95,8 +96,8 @@ config?: {
9596
// ... other custom parameters
9697
},
9798
// other sections config
98-
],
99-
},
99+
]
100+
}
100101
},
101102
// other views config
102103
]
@@ -116,6 +117,7 @@ In the **config** object you can specify the following parameters:
116117
- `eventsOverlay` - (optional) enables/disables an ability to overlay events
117118
- `autoSave` - (optional) enables/disables an ability to auto save event data (via the editor)
118119
- `readonly` - (optional) enables/disables an ability to perform operations on events
120+
- `highlightReadonly` - (optional) enables/disables highlighting the readonly events
119121
- `dimPastEvents` - (optional) enables/disables an ability to dim past events
120122
- `dateClick` - (optional) defines a behavior of clicking on the date in a grid cell in the following way:
121123
- ***true/false*** - enables/disables an ability to click on the date in a grid cell to go to the corresponding day
@@ -167,7 +169,7 @@ calendarValidation: calendar => {
167169
- `views` - (optional) an array of configuration objects of the specific (custom) view modes. For each view mode you can specify the following settings:
168170
- `id` - (required) an ID of the view mode
169171
- `label` - (required) a label of the view mode
170-
- `layout` - (required) a predefined layout of the view mode. Here you can specify the following values: *"year" | "month" | "quarter" | "month" | "week" | "day" | "hour" | "minute"*
172+
- `layout` - (required) a predefined layout of the view mode. Here you can specify the following values: *"year" | "month" | "week" | "day" | "agenda" | "timeline"*
171173
- `config` - (optional) an object of the custom view mode settings
172174

173175
:::note
@@ -217,11 +219,18 @@ const getMonday = (date) => {
217219

218220
// ...,
219221
views: [
220-
// ...,
221-
getBounds: (date) => {
222-
const weekStart = getMonday(date);
223-
return [weekStart, new Date(weekStart.getFullYear(), weekStart.getMonth(), weekStart.getDate() + 7)];
224-
},
222+
{
223+
id: 'timeline',
224+
label: 'Timeline',
225+
layout: 'timeline',
226+
config: {
227+
getBounds: (date) => {
228+
const weekStart = getMonday(date);
229+
return [weekStart, new Date(weekStart.getFullYear(), weekStart.getMonth(), weekStart.getDate() + 7)];
230+
},
231+
//...
232+
}
233+
}
225234
]
226235
~~~
227236

@@ -251,7 +260,7 @@ step: [8, "hour"], // "day" | "week" | "month" | "year" | "hour" | "minute"
251260
~~~
252261

253262
- `header?: array` - defines headers for the Timeline grid. In this array you can specify objects with the following parameters:
254-
- `unit: string` - a timeline unit. Here you can specify one of the following values: *"year" | "month" | "quarter" | "month" | "week" | "day" | "hour" | "minute"*
263+
- `unit: string` - a timeline unit. Here you can specify one of the following values: *"year" | "month" | "quarter" | "week" | "day" | "hour" | "minute"*
255264
- `format: string` - a time format (use a [date-fns](https://date-fns.org/) format)
256265
- `step: number` - a time duration
257266

@@ -291,12 +300,11 @@ sections: [
291300
~~~jsx {}
292301
const defaultWeekConfig = {
293302
eventHorizontalSpace: 3,
294-
columnPadding: "8px",
295-
303+
columnPadding: "8px"
296304
};
297305

298306
const defaultMonthConfig = {
299-
maxEventsPerCell: 4,
307+
maxEventsPerCell: 4
300308
};
301309

302310
const defaultTimelineConfig = {
@@ -322,7 +330,7 @@ const defaultTimelineConfig = {
322330
{ id: "8", label: "Section 8" },
323331
{ id: "9", label: "Section 9" },
324332
],
325-
unassignedCol: false,
333+
unassignedCol: false
326334
};
327335

328336
const defaultConfig = {
@@ -337,6 +345,7 @@ const defaultConfig = {
337345
eventsOverlay: false,
338346
autoSave: true,
339347
readonly: false,
348+
highlightReadonly: true,
340349

341350
tableHeaderHeight: 32,
342351
eventHeight: 24,
@@ -369,7 +378,7 @@ const defaultConfig = {
369378
},
370379
{ id: "year", label: "Year", layout: "year" },
371380
{ id: "agenda", label: "Agenda", layout: "agenda" },
372-
],
381+
]
373382
};
374383
~~~
375384

@@ -380,13 +389,14 @@ To set the **config** property dynamically, you can use the
380389

381390
### Example
382391

383-
~~~jsx {3-50}
392+
~~~jsx {3-51}
384393
// create Event Calendar
385394
new eventCalendar.EventCalendar("#root", {
386395
config: {
387396
autoSave: false,
388397
dragResize: false,
389398
readonly: true,
399+
highlightReadonly: false,
390400
dragMove: false,
391401
viewControl: "toggle",
392402
dimPastEvents: true,
@@ -429,7 +439,7 @@ new eventCalendar.EventCalendar("#root", {
429439
},
430440
},
431441
// other custom views config
432-
],
442+
]
433443
},
434444
// other configuration parameters
435445
});
@@ -442,3 +452,4 @@ new eventCalendar.EventCalendar("#root", {
442452
- The ***dateTitle***, ***eventVerticalSpace*** and ***eventHorizontalSpace*** properties were added in v2.1
443453
- The ***eventMargin*** property was deprecated in v2.1
444454
- The ***calendarValidation*** and ***defaultEditorValues*** properties were added in v2.2
455+
- The ***highlightReadonly*** property was added in v2.3

docs/api/config/js_eventcalendar_templates_config.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ To set the templates dynamically, you can use the
6363

6464
### Example
6565

66-
~~~jsx {5-14,16-22,24-30,32-44,46-55,57-63,65-73,75-88,90-97}
66+
~~~jsx {6-15,17-23,25-31,33-45,47-56,58-64,66-74,76-89,91-97}
67+
const { dateFns, EventCalendar } = eventCalendar;
6768
const { format } = dateFns; // date-fns library (https://date-fns.org/)
68-
new eventCalendar.EventCalendar("#root", { // create Event Calendar
69+
new EventCalendar("#root", { // create Event Calendar
6970
templates: {
7071
// the event template of the "Week" and "Day" modes
7172
weekEvent: ({ event, calendar }) => {

docs/api/events/js_eventcalendar_editevent_event.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,5 @@ calendar.api.on("edit-event", (obj) => {
8484
console.log(obj);
8585
});
8686
~~~
87+
88+
**Related sample:** [Event Calendar. Configuring editor fields at runtime](https://snippet.dhtmlx.com/22vzkltn?tag=event_calendar)

docs/guides/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
sidebar_label: Configuration
3-
title: Configuration
2+
sidebar_label: Common Configuration
3+
title: Common Configuration
44
description: You can learn about the configuration in the documentation of the DHTMLX JavaScript Event Calendar library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Event Calendar.
55
---
66

7-
# Configuration
7+
# Common Configuration
88

99
You can configure the *Event Calendar* appearance and functionality via corresponding API. The available parameters will allow you to:
1010

0 commit comments

Comments
 (0)