~~~js
-var config ={
- start_date: new Date(2012,7,13),
- end_date: new Date(2012,7,14),
+const config ={
+ start_date: new Date(2027,7,13),
+ end_date: new Date(2027,7,14),
css: "cssClassName",
sections: {
unit: 5
diff --git a/docs/api/method/message.md b/docs/api/method/message.md
index 20b877d5..7408b0fa 100644
--- a/docs/api/method/message.md
+++ b/docs/api/method/message.md
@@ -22,7 +22,7 @@ description: "calls a message box of the specified type"
### Example
~~~jsx
-var box = scheduler.message({
+const box = scheduler.message({
type:"confirm-warning",
text:"Are you sure you want to do it?"
});
diff --git a/docs/api/method/modalbox.md b/docs/api/method/modalbox.md
index 5d2f2152..90ebc64b 100644
--- a/docs/api/method/modalbox.md
+++ b/docs/api/method/modalbox.md
@@ -22,7 +22,7 @@ description: "calls a modalbox"
### Example
~~~jsx
-var box = scheduler.modalbox({
+const box = scheduler.modalbox({
title: "Close",
type: "alert-warning"
});
diff --git a/docs/api/method/parse.md b/docs/api/method/parse.md
index 3099a8bc..7e101f67 100644
--- a/docs/api/method/parse.md
+++ b/docs/api/method/parse.md
@@ -20,8 +20,8 @@ description: "loads data from a client-side resource"
~~~jsx
scheduler.parse([
- { start_date:"2020-05-13 6:00", end_date:"2020-05-13 8:00", text:"Event 1"},
- { start_date:"2020-06-09 6:00", end_date:"2020-06-09 8:00", text:"Event 2"}
+ { start_date: "2027-05-13 6:00", end_date: "2027-05-13 8:00", text: "Event 1" },
+ { start_date: "2027-06-09 6:00", end_date: "2027-06-09 8:00", text: "Event 2" }
]);
~~~
@@ -29,16 +29,14 @@ scheduler.parse([
- [Coloring events](https://docs.dhtmlx.com/scheduler/samples/02_customization/01_events_coloring.html)
- [Displaying events as a cascade](https://docs.dhtmlx.com/scheduler/samples/02_customization/24_cascade_event_display.html)
-### Details
-
## Migration
-In v5.2 and upper, scheduler detects the format of data automatically.
+In v5.2 and later, Scheduler detects the data format automatically.
But before v5.2, the method included two parameters:
-- **data** - (*object*) a string or object which represents data;
-- **type** - (*string*) optional, ('json', 'xml', 'ical') the data type. The default value - 'xml'
+- `data` - (*object*) a string or object that represents data
+- `type` - (*string*) optional, (*'json', 'xml', 'ical'*) the data type. The default value is *'xml'*
### Related API
- [onBeforeParse](api/event/onbeforeparse.md)
@@ -49,4 +47,4 @@ But before v5.2, the method included two parameters:
- [Examples of Data Formats](guides/data-formats.md)
### Change log
-- The second **type** parameter of the method has been removed in v5.2.
+- The second `type` parameter of the method was removed in v5.2.
diff --git a/docs/api/method/removeshortcut.md b/docs/api/method/removeshortcut.md
index d42d9f3c..3f5dc8aa 100644
--- a/docs/api/method/removeshortcut.md
+++ b/docs/api/method/removeshortcut.md
@@ -22,7 +22,7 @@ description: "removes a keyboard shortcut"
~~~jsx
// adding a shortcut
scheduler.addShortcut("shift+w", function(e){
- var eventId = scheduler.locate(e);
+ const eventId = scheduler.locate(e);
if(eventId)
scheduler.showQuickInfo(eventId);
},"event");
diff --git a/docs/api/method/render.md b/docs/api/method/render.md
index 15aec84a..4817649a 100644
--- a/docs/api/method/render.md
+++ b/docs/api/method/render.md
@@ -26,7 +26,7 @@ scheduler.render();
// switch to another date
-scheduler.render(new Date(2020,7,4));
+scheduler.render(new Date(2027,7,4));
// switch to another view
scheduler.render(null, "week");
diff --git a/docs/api/method/renderevent.md b/docs/api/method/renderevent.md
index 14f80625..c4c5b957 100644
--- a/docs/api/method/renderevent.md
+++ b/docs/api/method/renderevent.md
@@ -24,8 +24,8 @@ description: "generates HTML content for a custom event's box"
~~~jsx
scheduler.renderEvent = function(container, ev) {
- var container_width = container.style.width;
- var html = "";
...
container.innerHTML = html;
diff --git a/docs/api/method/resetlightbox.md b/docs/api/method/resetlightbox.md
index d07a7f9f..805f0e73 100644
--- a/docs/api/method/resetlightbox.md
+++ b/docs/api/method/resetlightbox.md
@@ -15,17 +15,17 @@ description: "removes the current lightbox's HTML object element"
### Example
~~~jsx
-var full_lightbox = [
+const full_lightbox = [
{ name: "description", map_to: "text", type: "textarea", focus: true},
{ name: "time", map_to: "auto", type: "time"}
];
-var restricted_lightbox = [
+const restricted_lightbox = [
{ name: "description", map_to: "text", type: "textarea", focus: true},
];
...
scheduler.attachEvent("onBeforeLightbox", function(event_id) {
scheduler.resetLightbox();
- var ev = scheduler.getEvent(event_id);
+ const ev = scheduler.getEvent(event_id);
if (ev.restricted ==true){
scheduler.config.lightbox.sections = restricted_lightbox;
} else {
diff --git a/docs/api/method/select.md b/docs/api/method/select.md
index 23f6772d..2e52cbdd 100644
--- a/docs/api/method/select.md
+++ b/docs/api/method/select.md
@@ -19,9 +19,9 @@ description: "selects the specified event"
### Example
~~~jsx
-var eventId = scheduler.addEvent({
- start_date: "16-06-2013 09:00",
- end_date: "16-06-2013 12:00",
+const eventId = scheduler.addEvent({
+ start_date: "16-06-2027 09:00",
+ end_date: "16-06-2027 12:00",
text: "Meeting"
});
diff --git a/docs/api/method/serialize.md b/docs/api/method/serialize.md
index 443e11a5..f30402a4 100644
--- a/docs/api/method/serialize.md
+++ b/docs/api/method/serialize.md
@@ -19,15 +19,15 @@ console.log(scheduler.serialize());
//(5) [{…}, {…}, {…}, {…}, {…}]
-//> 0: {id: 1, start_date: '2022-05-17 09:00', end_date: '2022-05-17 12:00',
+//> 0: {id: 1, start_date: '2027-05-17 09:00', end_date: '2027-05-17 12:00',
// text: 'Event'}
-//> 1: {id: 2, start_date: '2022-05-18 10:00', end_date: '2022-05-18 16:00',
+//> 1: {id: 2, start_date: '2027-05-18 10:00', end_date: '2027-05-18 16:00',
// text: 'Event'}
-//> 2: {id: 3, start_date: '2022-05-20 10:00', end_date: '2022-05-20 14:00',
+//> 2: {id: 3, start_date: '2027-05-20 10:00', end_date: '2027-05-20 14:00',
// text: 'Event'}
-//> 3: {id: 4, start_date: '2022-05-21 16:00', end_date: '2022-05-21 17:00',
+//> 3: {id: 4, start_date: '2027-05-21 16:00', end_date: '2027-05-21 17:00',
// text: 'Event'}
-//> 4: {id: 5, start_date: '2022-05-22 09:00', end_date: '2022-05-22 17:00',
+//> 4: {id: 5, start_date: '2027-05-22 09:00', end_date: '2027-05-22 17:00',
// text: 'Event'}
~~~
diff --git a/docs/api/method/serverlist.md b/docs/api/method/serverlist.md
index 704728db..c8d60422 100644
--- a/docs/api/method/serverlist.md
+++ b/docs/api/method/serverlist.md
@@ -24,10 +24,10 @@ description: "defines a named collection that can be loaded into Units, Timeline
~~~jsx
//returns a list of options with the name 'my_list'
-var list = scheduler.serverList("my_list");
+const list = scheduler.serverList("my_list");
...
//creates and returns the specified list
-var list = scheduler.serverList("options", [
+const list = scheduler.serverList("options", [
{key: 1, label: "John"},
{key: 2, label: "Adam"},
{key: 3, label: "Diane"}
diff --git a/docs/api/method/setcurrentview.md b/docs/api/method/setcurrentview.md
index 50b43e97..2766120a 100644
--- a/docs/api/method/setcurrentview.md
+++ b/docs/api/method/setcurrentview.md
@@ -15,17 +15,17 @@ description: "displays the specified view and date"
### Parameters
- `date` - (optional) *Date* - the date to display
-- `view` - (optional) *string* - the name of a view to display
+- `view` - (optional) *string* - the name of a view to display
### Example
~~~jsx
-//displays the current view and date. Doesn't change anything, just refreshes
+// displays the current view and date. Doesn't change anything, just refreshes
scheduler.setCurrentView();
-// displays the 4th July,2012 in the currently active view
-scheduler.setCurrentView(new Date(2012,7,4));
-// displays the 3rd May,2012 in the Week view
-scheduler.setCurrentView(new Date(2012,5,3), "week");
+// displays 2027-08-04 in the currently active view
+scheduler.setCurrentView(new Date(2027, 7, 4));
+// displays 2027-06-03 in the Week view
+scheduler.setCurrentView(new Date(2027, 5, 3), "week");
~~~
### Related samples
@@ -34,9 +34,9 @@ scheduler.setCurrentView(new Date(2012,5,3), "week");
### Details
-- The names for default views are 'day', 'week', 'month'. To specify any other view - use its name parameter.
-- The method invokes the [onBeforeViewChange](api/event/onbeforeviewchange.md), [onViewChange](api/event/onviewchange.md).
-- The method is similar to [updateView](api/method/updateview.md). The only difference between methods is that [updateView](api/method/updateview.md) **doesn't generate any events**.
+- The names for default views are 'day', 'week', 'month'. To specify any other view, use its `name` parameter.
+- The method invokes [`onBeforeViewChange`](api/event/onbeforeviewchange.md) and [`onViewChange`](api/event/onviewchange.md).
+- The method is similar to [`updateView()`](api/method/updateview.md). The only difference is that [`updateView()`](api/method/updateview.md) doesn't generate any events.
### Related API
- [onBeforeViewChange](api/event/onbeforeviewchange.md)
diff --git a/docs/api/method/setevent.md b/docs/api/method/setevent.md
index 6f8d2e37..2b3f21d6 100644
--- a/docs/api/method/setevent.md
+++ b/docs/api/method/setevent.md
@@ -21,8 +21,8 @@ description: "adds a new event to the scheduler's data pool"
~~~jsx
scheduler.setEvent(1, {
- start_date: new Date(2013, 05, 16, 09, 00),
- end_date: new Date(2013, 05, 16, 12, 00),
+ start_date: new Date(2027, 05, 16, 09, 00),
+ end_date: new Date(2027, 05, 16, 12, 00),
text: "Meeting",
holder: "John",
room: "5"
diff --git a/docs/api/method/seteventenddate.md b/docs/api/method/seteventenddate.md
index fdc051e8..c16f7247 100644
--- a/docs/api/method/seteventenddate.md
+++ b/docs/api/method/seteventenddate.md
@@ -22,13 +22,13 @@ The method is deprecated.
### Example
~~~jsx
-var eventId = scheduler.addEvent({
- start_date: new Date(2013,1,10),
- end_date: new Date(2013,1,13),
+const eventId = scheduler.addEvent({
+ start_date: new Date(2027,1,10),
+ end_date: new Date(2027,1,13),
text: "Conference"
});
...
-scheduler.getEvent(eventId).end_date = new Date(2013,1,15);
+scheduler.getEvent(eventId).end_date = new Date(2027,1,15);
scheduler.updateEvent(eventId);
~~~
diff --git a/docs/api/method/seteventstartdate.md b/docs/api/method/seteventstartdate.md
index da952c27..a5d358f9 100644
--- a/docs/api/method/seteventstartdate.md
+++ b/docs/api/method/seteventstartdate.md
@@ -22,13 +22,13 @@ The method is deprecated.
### Example
~~~jsx
-var eventId = scheduler.addEvent({
- start_date: new Date(2013,1,10),
- end_date: new Date(2013,1,13),
+const eventId = scheduler.addEvent({
+ start_date: new Date(2027,1,10),
+ end_date: new Date(2027,1,13),
text: "Conference"
});
...
-scheduler.getEvent(eventId).start_date = new Date(2013,1,09);
+scheduler.getEvent(eventId).start_date = new Date(2027,1,09);
scheduler.updateEvent(eventId);
~~~
diff --git a/docs/api/method/seteventtext.md b/docs/api/method/seteventtext.md
index 38ce9568..7f357df7 100644
--- a/docs/api/method/seteventtext.md
+++ b/docs/api/method/seteventtext.md
@@ -22,9 +22,9 @@ The method is deprecated.
### Example
~~~jsx
-var eventId = scheduler.addEvent({
- start_date: new Date(2013,1,10),
- end_date: new Date(2013,1,13),
+const eventId = scheduler.addEvent({
+ start_date: new Date(2027,1,10),
+ end_date: new Date(2027,1,13),
text: "Conference"
});
...
diff --git a/docs/api/method/setlightboxsize.md b/docs/api/method/setlightboxsize.md
index 88b58daf..2ff2267a 100644
--- a/docs/api/method/setlightboxsize.md
+++ b/docs/api/method/setlightboxsize.md
@@ -15,7 +15,7 @@ description: "forces the lightbox to resize"
### Example
~~~jsx
-var control = scheduler.formSection("description");
+const control = scheduler.formSection("description");
control.header.style.display = "none";
scheduler.setLightboxSize();
diff --git a/docs/api/method/setloadmode.md b/docs/api/method/setloadmode.md
index 34b755cf..359f13cd 100644
--- a/docs/api/method/setloadmode.md
+++ b/docs/api/method/setloadmode.md
@@ -20,7 +20,7 @@ description: "sets the mode that allows loading data by parts (enables the dynam
~~~jsx
scheduler.config.load_date = "%Y.%m.%d";
-scheduler.init('scheduler_here',new Date(2009,10,1),"month");
+scheduler.init('scheduler_here',new Date(2027,10,1),"month");
scheduler.setLoadMode("month")
scheduler.load("data/events.php");
diff --git a/docs/api/method/setuserdata.md b/docs/api/method/setuserdata.md
index 2c20ff70..cfda554f 100644
--- a/docs/api/method/setuserdata.md
+++ b/docs/api/method/setuserdata.md
@@ -21,9 +21,9 @@ description: "sets the user data associated with the specified event"
### Example
~~~jsx
-var eventId = scheduler.addEvent({
- start_date: "16-06-2013 09:00",
- end_date: "16-06-2013 12:00",
+const eventId = scheduler.addEvent({
+ start_date: "16-06-2027 09:00",
+ end_date: "16-06-2027 12:00",
text: "Meeting"
});
diff --git a/docs/api/method/showevent.md b/docs/api/method/showevent.md
index e049a2e1..7b3e9457 100644
--- a/docs/api/method/showevent.md
+++ b/docs/api/method/showevent.md
@@ -39,9 +39,9 @@ scheduler.showEvent(someId);
For example, you programmatically add a new event and want to show it in the scheduler:
~~~js
-var eventId = scheduler.addEvent({
- start_date: "08-06-2013 09:00",
- end_date: "08-06-2013 11:00",
+const eventId = scheduler.addEvent({
+ start_date: "08-06-2027 09:00",
+ end_date: "08-06-2027 11:00",
text: "Meeting"
});
...
diff --git a/docs/api/method/showlightbox.md b/docs/api/method/showlightbox.md
index f2c2f3a4..e47d3940 100644
--- a/docs/api/method/showlightbox.md
+++ b/docs/api/method/showlightbox.md
@@ -19,9 +19,9 @@ description: "opens the lightbox for the specified event"
### Example
~~~jsx
-var eventId = scheduler.addEvent({
- start_date: "08-06-2013 09:00",
- end_date: "08-06-2013 11:00",
+const eventId = scheduler.addEvent({
+ start_date: "08-06-2027 09:00",
+ end_date: "08-06-2027 11:00",
text: "Meeting"
});
...
diff --git a/docs/api/method/showquickinfo.md b/docs/api/method/showquickinfo.md
index e3df6ad0..a385a8ae 100644
--- a/docs/api/method/showquickinfo.md
+++ b/docs/api/method/showquickinfo.md
@@ -19,9 +19,9 @@ description: "displays the pop-up event form for the specified event"
### Example
~~~jsx
-var eventId = scheduler.addEvent({
- start_date: "08-06-2013 09:00",
- end_date: "08-06-2013 11:00",
+const eventId = scheduler.addEvent({
+ start_date: "08-06-2027 09:00",
+ end_date: "08-06-2027 11:00",
text: "Meeting"
});
diff --git a/docs/api/method/toical.md b/docs/api/method/toical.md
index 918cfb06..f3074716 100644
--- a/docs/api/method/toical.md
+++ b/docs/api/method/toical.md
@@ -21,9 +21,9 @@ description: "converts scheduler's data to the ICal format"
### Example
~~~jsx
-var str = scheduler.toICal();
+const str = scheduler.toICal();
//or
-var str = scheduler.toICal("My calendar");
+const str = scheduler.toICal("My calendar");
~~~
### Related samples
diff --git a/docs/api/method/tojson.md b/docs/api/method/tojson.md
index 64893ac8..8f82ce8c 100644
--- a/docs/api/method/tojson.md
+++ b/docs/api/method/tojson.md
@@ -18,7 +18,7 @@ description: "converts scheduler's data into the JSON format"
### Example
~~~jsx
-var str = scheduler.toJSON();
+const str = scheduler.toJSON();
~~~
### Related samples
diff --git a/docs/api/method/topdfrange.md b/docs/api/method/topdfrange.md
index ea7ba108..4e3a0af9 100644
--- a/docs/api/method/topdfrange.md
+++ b/docs/api/method/topdfrange.md
@@ -23,9 +23,9 @@ description: "exports several scheduler's views to a PDF document (can be used f
### Example
~~~jsx
-//exports pages of the 'week' view from the 1st January, 2012
-//till the 1st February, 2012
-scheduler.toPDFRange(new Date(2012,0,1), new Date(2012, 1,1),'week',
+//exports pages of the 'week' view from the 1st January, 2027
+//till the 1st February, 2027
+scheduler.toPDFRange(new Date(2027,0,1), new Date(2027, 1,1),'week',
'generate.php', 'fullcolor');
~~~
diff --git a/docs/api/method/toxml.md b/docs/api/method/toxml.md
index 6e3318e7..e65a7ec4 100644
--- a/docs/api/method/toxml.md
+++ b/docs/api/method/toxml.md
@@ -18,7 +18,7 @@ description: "converts scheduler's data into the XML format"
### Example
~~~jsx
-var str = scheduler.toXML();
+const str = scheduler.toXML();
~~~
### Related samples
diff --git a/docs/api/method/uid.md b/docs/api/method/uid.md
index 8e59b49d..049a38e7 100644
--- a/docs/api/method/uid.md
+++ b/docs/api/method/uid.md
@@ -18,5 +18,5 @@ description: "generates a unique ID (unique inside the current scheduler, not GU
### Example
~~~jsx
-var new_id = scheduler.uid();
+const new_id = scheduler.uid();
~~~
diff --git a/docs/api/method/unblocktime.md b/docs/api/method/unblocktime.md
index 2c05d292..12664ce2 100644
--- a/docs/api/method/unblocktime.md
+++ b/docs/api/method/unblocktime.md
@@ -23,10 +23,10 @@ The method is deprecated.
### Example
~~~jsx
-var spanId = scheduler.blockTime(new Date(2013,2,5), "fullday");
+const spanId = scheduler.blockTime(new Date(2027,2,5), "fullday");
...
-//cancels blocking from 0 till 8 and from 18 till 24 hours for February 5, 2013
-scheduler.unblockTime(new Date(2013,2,5), [0,10*60]);
+//cancels blocking from 0 till 8 and from 18 till 24 hours for February 5, 2027
+scheduler.unblockTime(new Date(2027,2,5), [0,10*60]);
~~~
### Related API
diff --git a/docs/api/method/unmarkcalendar.md b/docs/api/method/unmarkcalendar.md
index ebc4109e..0c6a894d 100644
--- a/docs/api/method/unmarkcalendar.md
+++ b/docs/api/method/unmarkcalendar.md
@@ -24,7 +24,7 @@ description: "removes a css class from the specified date"
// you can get the calendar object in one of two ways:
// either via creating a mini calendar
-var calendar = scheduler.renderCalendar({
+const calendar = scheduler.renderCalendar({
container:"cal_here",
navigation:true,
handler:function(date){
@@ -33,11 +33,11 @@ var calendar = scheduler.renderCalendar({
});
// or via using the selector of the container with the mini calendar
-var calendar = document.querySelector(".dhx_mini_calendar");
+const calendar = document.querySelector(".dhx_mini_calendar");
-scheduler.markCalendar(calendar, new Date(2010,3,1), "my_style");
+scheduler.markCalendar(calendar, new Date(2027,3,1), "my_style");
...
-scheduler.unmarkCalendar(calendar, new Date(2010,3,1), "my_style");
+scheduler.unmarkCalendar(calendar, new Date(2027,3,1), "my_style");
~~~
### Details
diff --git a/docs/api/method/unmarktimespan.md b/docs/api/method/unmarktimespan.md
index 571c2916..e8abc784 100644
--- a/docs/api/method/unmarktimespan.md
+++ b/docs/api/method/unmarktimespan.md
@@ -19,7 +19,7 @@ description: "removes marking/blocking set by the markTimespan() method"
### Example
~~~jsx
-var spanDIV = scheduler.markTimespan({
+const spanDIV = scheduler.markTimespan({
days: [0,6],
zones: "fullday"
});
diff --git a/docs/api/method/unselect.md b/docs/api/method/unselect.md
index 80660d7e..719be15a 100644
--- a/docs/api/method/unselect.md
+++ b/docs/api/method/unselect.md
@@ -18,9 +18,9 @@ description: "unselects the specified event"
### Example
~~~jsx
-var eventId = scheduler.addEvent({
- start_date: "16-06-2013 09:00",
- end_date: "16-06-2013 12:00",
+const eventId = scheduler.addEvent({
+ start_date: "16-06-2027 09:00",
+ end_date: "16-06-2027 12:00",
text: "Meeting"
});
diff --git a/docs/api/method/updatecalendar.md b/docs/api/method/updatecalendar.md
index 903cbdac..3a38ddd5 100644
--- a/docs/api/method/updatecalendar.md
+++ b/docs/api/method/updatecalendar.md
@@ -20,7 +20,7 @@ description: "displays the specified date in the mini calendar"
### Example
~~~jsx
-var calendar = scheduler.renderCalendar({
+const calendar = scheduler.renderCalendar({
container:"cal_here",
navigation:true,
handler:function(date){
@@ -28,7 +28,7 @@ var calendar = scheduler.renderCalendar({
}
});
...
-scheduler.updateCalendar(calendar, new Date(2013,01,01));
+scheduler.updateCalendar(calendar, new Date(2027,01,01));
~~~
### Details
diff --git a/docs/api/method/updateevent.md b/docs/api/method/updateevent.md
index 18bfcb14..24acc86d 100644
--- a/docs/api/method/updateevent.md
+++ b/docs/api/method/updateevent.md
@@ -19,9 +19,9 @@ description: "updates the specified event"
### Example
~~~jsx
-var eventId = scheduler.addEvent({
- start_date: "16-06-2013 09:00",
- end_date: "16-06-2013 12:00",
+const eventId = scheduler.addEvent({
+ start_date: "16-06-2027 09:00",
+ end_date: "16-06-2027 12:00",
text: "Meeting"
});
diff --git a/docs/api/method/updateview.md b/docs/api/method/updateview.md
index 347e6382..32bd982e 100644
--- a/docs/api/method/updateview.md
+++ b/docs/api/method/updateview.md
@@ -14,18 +14,18 @@ description: "displays the specified view and date (doesn't invoke any events)"
### Parameters
-- `date` - (optional) *Date* - the date to set
-- `id` - (optional) *string* - the view name
+- `date` - (optional) *Date* - the date to set
+- `view` - (optional) *string* - the view name
### Example
~~~jsx
-//displays the current view and date. Doesn't change anything, just refreshes
+// displays the current view and date. Doesn't change anything, just refreshes
scheduler.updateView();
-// displays the 4th July,2012 in the currently active view
-scheduler.updateView(new Date(2012,7,4));
-// displays the 3rd May,2012 in the Week view
-scheduler.updateView(new Date(2012,5,3), "week");
+// displays 2027-08-04 in the currently active view
+scheduler.updateView(new Date(2027, 7, 4));
+// displays 2027-06-03 in the Week view
+scheduler.updateView(new Date(2027, 5, 3), "week");
~~~
### Related samples
@@ -33,9 +33,9 @@ scheduler.updateView(new Date(2012,5,3), "week");
### Details
-- Being invoked without parameters, the function will just refresh the current view.
-- The names for default views are 'day', 'week', 'month'. To specify any other view - use its **name** parameter.
-- The method is similar to [setCurrentView](api/method/setcurrentview.md). The only difference between methods is that unlike **updateView**, [setCurrentView](api/method/setcurrentview.md) generates the [onBeforeViewChange](api/event/onbeforeviewchange.md), [onViewChange](api/event/onviewchange.md) events.
+- Being invoked without parameters, the function will just refresh the current view.
+- The names for default views are 'day', 'week', 'month'. To specify any other view, use its `name` parameter.
+- The method is similar to [`setCurrentView()`](api/method/setcurrentview.md). The only difference is that unlike `updateView()`, [`setCurrentView()`](api/method/setcurrentview.md) generates the [`onBeforeViewChange`](api/event/onbeforeviewchange.md) and [`onViewChange`](api/event/onviewchange.md) events.
### Related API
- [setCurrentView](api/method/setcurrentview.md)
diff --git a/docs/api/other/ajax.md b/docs/api/other/ajax.md
index 013df98e..10d3c044 100644
--- a/docs/api/other/ajax.md
+++ b/docs/api/other/ajax.md
@@ -19,11 +19,11 @@ description: "scheduler ajax module"
{status: "ok", data: "value", data2: "value2"}
-var xhr = scheduler.ajax;
+const xhr = scheduler.ajax;
// HTTP GET
xhr.get("server.php").then(function(response) {
- var res = JSON.parse(response.responseText);
+ const res = JSON.parse(response.responseText);
if (res && res.status == "ok") {
// response is ok
}
@@ -36,7 +36,7 @@ xhr.post({
paramName: "paramValue"
}
}).then(function(response){
- var res = JSON.parse(response.responseText);
+ const res = JSON.parse(response.responseText);
if (res && res.status == "ok") {
// response is ok
}
@@ -107,7 +107,7 @@ scheduler.ajax.post({
paramName: "paramValue"
},
callback: function(result){
- var response = result.xmlDoc;
+ const response = result.xmlDoc;
alert(response.responseText);
}
@@ -221,7 +221,7 @@ dhtmlxScheduler supports usage of promises (including IE8+). For work with promi
To create a promise, you need to use the following constructor:
~~~js
-var promise = new scheduler.Promise(function(resolve, reject) {...});
+const promise = new scheduler.Promise(function(resolve, reject) {...});
~~~
Promise is declared inside Scheduler, not globally for the application.
diff --git a/docs/api/other/date.md b/docs/api/other/date.md
index 665bd69e..4349e4b3 100644
--- a/docs/api/other/date.md
+++ b/docs/api/other/date.md
@@ -15,123 +15,124 @@ description: "a set of date formatting methods"
### Details
-The **date** object provides the following methods:
+The `date` object provides the following methods:
-- **add**(date, number, unit) - adds/subtracts the specified time interval to/from the date
- - **date** - (Date) the date object that you need to add a time to/subtract a time from
- - **number** - (number) the number of units to add. If this number is positive - the time will be added to the date, if negative - the time will be subtracted
- - **unit** - ('minute', 'hour', 'day', 'week', 'month', 'year') the time unit
+- `add()` - adds/subtracts the specified time interval to/from the date
+ - `date` - (Date) the date object that you need to add time to/subtract time from
+ - `number` - (number) the number of units to add. If this number is positive, the time will be added to the date; if negative, the time will be subtracted
+ - `unit` - ('minute', 'hour', 'day', 'week', 'month', 'year') the time unit
~~~js
-//adds 1 year to the specified date: 29 June, 2019 -> 29 June, 2014
-var newDate = scheduler.date.add(new Date(2019, 05, 29), 1, 'year');
+// adds 1 year to the specified date: 29 June, 2027 -> 29 June, 2028
+const newDate = scheduler.date.add(new Date(2027, 5, 29), 1, 'year');
~~~
-- **convert_to_utc**(date) - converts local time to UTC
- - **date** - (Date) the date object to convert
+- `convert_to_utc()` - converts local time to UTC
+ - `date` - (Date) the date object to convert
~~~js
-//29 June, 2019 14:00 (local time) -> 29 June, 2019 12:00 (utc)
-var time = scheduler.date.convert_to_utc(new Date(2019, 05, 29, 14, 00));
+// 29 June, 2027 14:00 (local time) -> 29 June, 2027 12:00 (UTC)
+const time = scheduler.date.convert_to_utc(new Date(2027, 5, 29, 14, 0));
~~~
-- **copy**(date)- makes a copy of a Date object
- - **date** - (Date) the date object to copy
+- `copy()` - makes a copy of a Date object
+ - `date` - (Date) the date object to copy
~~~js
-var copy = scheduler.date.copy(new Date(2019, 05, 29));// -> 29 June, 2019
+const copy = scheduler.date.copy(new Date(2027, 5, 29)); // -> 29 June, 2027
~~~
-- **date_part**(date) - resets the time part of the provided date to 00:00:00
- - **date** - (Date) the date object to format
+- `date_part()` - resets the time part of the provided date to 00:00:00
+ - `date` - (Date) the date object to format
~~~js
-//29 June, 2019 14:30:10 -> 29 June, 2019 00:00:00
-var date = scheduler.date.date_part(new Date(2019, 05, 29, 14, 30, 10));
+// 29 June, 2027 14:30:10 -> 29 June, 2027 00:00:00
+const date = scheduler.date.date_part(new Date(2027, 5, 29, 14, 30, 10));
~~~
-- **date_to_str**(format, utc) - returns a function that converts a Date object to a string of the specified format
- - **format**> - (string) the date format (see [Date Format Specification](guides/settings-format.md))
- - **utc** - (boolean) specifies whether local time should be converted to UTC
+- `date_to_str()` - returns a function that converts a Date object to a string of the specified format
+Parameters: `format` - (string) the date format (see [Date Format Specification](guides/settings-format.md))
+`utc` - (boolean) specifies whether local time should be converted to UTC
~~~js
-var formatFunc = scheduler.date.date_to_str("%d/%m/%Y");
-var date = formatFunc(new Date(2019, 05, 29)); // -> "29/06/2019"
+const formatFunc = scheduler.date.date_to_str("%d/%m/%Y");
+const date = formatFunc(new Date(2027, 5, 29)); // -> "29/06/2027"
~~~
-- **day_start**(date) - resets the time part of the provided date to 00:00:00. Alias of the date_part method. Used by the Day view to set the display date and can be redefined to provide the default behaviour
- - **date** - (Date) the date object to format
+- `day_start()` - resets the time part of the provided date to 00:00:00. Alias of the `date_part()` method. Used by the Day view to set the display date and can be redefined to provide the default behavior
+Parameters: `date` - (Date) the date object to format
~~~js
-//29 June, 2019 14:30:10 -> 29 June, 2019 00:00:00
-var date = scheduler.date.day_start(new Date(2019, 05, 29, 14, 30, 10));
+// 29 June, 2027 14:30:10 -> 29 June, 2027 00:00:00
+const date = scheduler.date.day_start(new Date(2027, 5, 29, 14, 30, 10));
~~~
->**Note**, the date passed to the method will be actually changed. You may prevent the original date from being changed by wrapping the input date with *new Date*. For instance:
+> **Note**, the date passed to the method will actually be changed. You may prevent the original date from being changed by wrapping the input date with `new Date()`. For instance:
~~~js
-var date1 = new Date(2019, 05, 29, 14, 30, 10))
-var date2 = scheduler.date.day_start(new Date(date1))
+const originalDate = new Date(2027, 5, 29, 14, 30, 10);
+const dayStartDate = scheduler.date.day_start(new Date(originalDate));
~~~
-- **getISOWeek**(date)- returns the week number of the date
- - **date** - (Date) the date object to format
+- `getISOWeek()` - returns the week number of the date
+ - `date` - (Date) the date object to format
~~~js
-var week = scheduler.date.getISOWeek(new Date(2019, 05, 29)); // ->26
+const week = scheduler.date.getISOWeek(new Date(2027, 5, 29)); // -> 26
~~~
-- **getUTCISOWeek**(date) - returns the week number of the date, but previously converts local time to UTC
- - **date** - (Date) the date object to format
+- `getUTCISOWeek()` - returns the week number of the date, but previously converts local time to UTC
+ - `date` - (Date) the date object to format
~~~js
-var week = scheduler.date.getUTCISOWeek(new Date(2019, 05, 29)); // ->26
+const week = scheduler.date.getUTCISOWeek(new Date(2027, 5, 29)); // -> 26
~~~
-- **month_start**(date) - returns a Date object of the first day of the month for the specified date and clears the time part to zero
- - **date** - (Date) the date object to format
+- `month_start()` - returns a Date object of the first day of the month for the specified date and clears the time part to zero
+ - `date` - (Date) the date object to format
~~~js
-//29 June, 2019 14:30 -> 01 June, 2019 00:00
-var firstDay = scheduler.date.month_start(new Date(2019, 05, 29, 14, 30));
+// 29 June, 2027 14:30 -> 01 June, 2027 00:00
+const firstDay = scheduler.date.month_start(new Date(2027, 5, 29, 14, 30));
~~~
-- **str_to_date**(format,utc,parseExact) - returns a function that converts a string of the specified format to a Date object
- - **format** - (string) the date format ( see [Date Format Specification](guides/settings-format.md))
- - **utc** - (boolean) specifies whether local time should be converted to UTC
- - **parseExact** - (boolean) defines whether Scheduler identifies the format of a date automatically (*false*, default) or uses the format passed a user (*true*)
+
+- `str_to_date()` - returns a function that converts a string of the specified format to a Date object
+Parameters: `format` - (string) the date format (see [Date Format Specification](guides/settings-format.md))
+`utc` - (boolean) specifies whether local time should be converted to UTC
+`parseExact` - (boolean) defines whether Scheduler identifies the format of a date automatically (*false*, default) or uses the format passed by a user (*true*)
~~~js
-var formatFunc = scheduler.date.str_to_date("%d/%m/%Y");
-var date = formatFunc("29/06/2019"); // -> 29 June, 2019 00:00:00
+const formatFunc = scheduler.date.str_to_date("%d/%m/%Y");
+const date = formatFunc("29/06/2027"); // -> 29 June, 2027 00:00:00
~~~
-- **time_part**(date) - returns the time of a Date object as a number of seconds counted from the midnight (00:00:00)
- - **date** - (Date) the date object to format
+- `time_part()` - returns the time of a Date object as a number of seconds counted from midnight (00:00:00)
+ - `date` - (Date) the date object to format
~~~js
-var time = scheduler.date.time_part(new Date(2019, 05, 29, 14, 30, 10));
-//time -> 52210
+const time = scheduler.date.time_part(new Date(2027, 5, 29, 14, 30, 10));
+// time -> 52210
~~~
-- **to_fixed**(num) - adds the leading zero to numbers less than 10 and returns the result as a string. Doesn't affect numbers from 10
- - **num** - (number) the number to format
+- `to_fixed()` - adds the leading zero to numbers less than 10 and returns the result as a string. Doesn't affect numbers from 10
+ - `num` - (number) the number to format
~~~js
-var num1 = scheduler.date.to_fixed(2);// ->"02"
-var num2 = scheduler.date.to_fixed(10);// ->10
+const num1 = scheduler.date.to_fixed(2); // -> "02"
+const num2 = scheduler.date.to_fixed(10); // -> 10
~~~
-- **week_start**(date) - returns a Date object of the first day of the week for the specified date and clears the time part to zero
- - **date** - (Date) the date object to format
+- `week_start()` - returns a Date object of the first day of the week for the specified date and clears the time part to zero
+ - `date` - (Date) the date object to format
~~~js
-//29 June, 2019 14:30 -> 24 June, 2019 00:00
-var weekStart = scheduler.date.week_start(new Date(2019, 05, 29, 14, 30));
+// 29 June, 2027 14:30 -> 28 June, 2027 00:00
+const weekStart = scheduler.date.week_start(new Date(2027, 5, 29, 14, 30));
~~~
-- **year_start**(date) - returns a Date object of the first day of the year for the specified date and clears the time part to zero
- - **date** - (Date) the date object to format
+- `year_start()` - returns a Date object of the first day of the year for the specified date and clears the time part to zero
+ - `date` - (Date) the date object to format
~~~js
-//29 June, 2019 14:30 -> 01 January, 2019 00:00
-var yearStart = scheduler.date.year_start(new Date(2019, 05, 29, 14, 30));
+// 29 June, 2027 14:30 -> 01 January, 2027 00:00
+const yearStart = scheduler.date.year_start(new Date(2027, 5, 29, 14, 30));
~~~
diff --git a/docs/api/other/json.md b/docs/api/other/json.md
index c806680d..61cdf5eb 100644
--- a/docs/api/other/json.md
+++ b/docs/api/other/json.md
@@ -15,7 +15,7 @@ description: "specifies JSON serialization and parsing"
### Example
~~~jsx
-var obj = scheduler.json; // -> { parse(data){... }}
+const obj = scheduler.json; // -> { parse(data){... }}
~~~
### Details
diff --git a/docs/api/other/matrix.md b/docs/api/other/matrix.md
index 6d7a3118..e123a2c1 100644
--- a/docs/api/other/matrix.md
+++ b/docs/api/other/matrix.md
@@ -28,7 +28,7 @@ scheduler.createTimelineView({
render:"bar"
});
-var configObj = scheduler.matrix;
+const configObj = scheduler.matrix;
~~~
### Related samples
@@ -57,7 +57,7 @@ But if you need to change the configuration greatly, it will be better to specif
For example, you want to dynamically change the x_step,x_sise,x_start parameters of the timeline shown in the sample above:
-~~~
+~~~js
//you can use this variant
configObj.x_step = 50;
configObj.x_size = 28;
diff --git a/docs/api/other/skin.md b/docs/api/other/skin.md
index 1e424c4f..83aec4e7 100644
--- a/docs/api/other/skin.md
+++ b/docs/api/other/skin.md
@@ -15,7 +15,7 @@ description: "returns the current skin of the scheduler"
### Example
~~~jsx
-var currentSkin = scheduler.skin;// -> 'glossy' or 'classic'
+const currentSkin = scheduler.skin;// -> 'glossy' or 'classic'
~~~
### Details
diff --git a/docs/api/other/tooltip.md b/docs/api/other/tooltip.md
index 9effc587..0aa23f6e 100644
--- a/docs/api/other/tooltip.md
+++ b/docs/api/other/tooltip.md
@@ -15,7 +15,7 @@ description: "displays tooltips for events"
### Example
~~~jsx
-var tooltip = scheduler.tooltip;
+const tooltip = scheduler.tooltip;
tooltip.hide();
tooltip.show(event, text);
~~~
diff --git a/docs/api/other/version.md b/docs/api/other/version.md
index 752acd4a..774e37b6 100644
--- a/docs/api/other/version.md
+++ b/docs/api/other/version.md
@@ -15,5 +15,5 @@ description: "returns the version of dhtmlxScheduler"
### Example
~~~jsx
-var version = scheduler.version; // "4.0"
+const version = scheduler.version; // "4.0"
~~~
diff --git a/docs/api/overview/others_overview.md b/docs/api/overview/others_overview.md
index 72bf4232..a506ed3b 100644
--- a/docs/api/overview/others_overview.md
+++ b/docs/api/overview/others_overview.md
@@ -12,7 +12,7 @@ description: You can explore Others overview in the documentation of the DHTMLX
| [](api/other/config.md) | @getshort(api/other/config.md) |
| [](api/other/date.md) | @getshort(api/other/date.md) |
| [](api/other/env.md) | @getshort(api/other/env.md) |
-| [](api/other/i18n.md) | @getshort(api/other/i18n.md) |
+| [](api/other/i18n.md) | @getshort(api/other/i18n.md) |
| [](api/other/ical.md) | @getshort(api/other/ical.md) |
| [](api/other/json.md) | @getshort(api/other/json.md) |
| [](api/other/keys.md) | @getshort(api/other/keys.md) |
diff --git a/docs/api/template/day_date.md b/docs/api/template/day_date.md
index f72fef61..6cac1f0a 100644
--- a/docs/api/template/day_date.md
+++ b/docs/api/template/day_date.md
@@ -23,7 +23,7 @@ description: "specifies the date in the header of the Day and Units views"
~~~jsx
scheduler.templates.day_date = function(date){
- var formatFunc = scheduler.date.date_to_str(scheduler.config.default_date);
+ const formatFunc = scheduler.date.date_to_str(scheduler.config.default_date);
return formatFunc(date);
};
~~~
diff --git a/docs/api/template/event_bar_text.md b/docs/api/template/event_bar_text.md
index 609bcc71..ade7fe1f 100644
--- a/docs/api/template/event_bar_text.md
+++ b/docs/api/template/event_bar_text.md
@@ -14,18 +14,18 @@ description: "specifies the event's text. Applied to multi-day events only"
### Parameters
-- `start` - (required) *Date* - the date when an event is scheduled to begin
+- `start` - (required) *Date* - the date when an event is scheduled to begin
- `end` - (required) *Date* - the date when an event is scheduled to be completed
- `event` - (required) *object* - the event's object
### Returns
-- ` text` - (string) - html text for rendering in the scheduler
+- `text` - (string) - HTML text for rendering in the Scheduler
### Example
~~~jsx
-scheduler.templates.event_bar_text = function(start,end,event){
- return event.text;
+scheduler.templates.event_bar_text = (start, end, event) => {
+ return event.text;
};
~~~
diff --git a/docs/api/template/event_class.md b/docs/api/template/event_class.md
index 53be794f..6da3040b 100644
--- a/docs/api/template/event_class.md
+++ b/docs/api/template/event_class.md
@@ -14,17 +14,17 @@ description: "specifies the CSS class that will be applied to the event's contai
### Parameters
-- `start` - (required) *Date* - the date when an event is scheduled to begin
+- `start` - (required) *Date* - the date when an event is scheduled to begin
- `end` - (required) *Date* - the date when an event is scheduled to be completed
- `ev` - (required) *object* - the event's object
### Returns
-- ` css_class` - (string) - css class for related element
+- `css_class` - (string) - the CSS class for the related element
### Example
~~~jsx
-scheduler.templates.event_class = function(start,end,ev){
+scheduler.templates.event_class = (start, end, ev) => {
return "";
};
~~~
@@ -37,9 +37,9 @@ scheduler.templates.event_class = function(start,end,ev){
### Details
-In case of the Timeline view, the template is applied to 'Bar' and 'Tree' modes only.
+In the Timeline view, the template is applied to 'Bar' and 'Tree' modes only.
-Check the full information about customization of events colors in the related article [Custom Event's Color](guides/custom-events-color.md).
+Check the full information about customizing event colors in the related article [Custom Event's Color](guides/custom-events-color.md).
### Related Guides
- [Custom Event's Color](guides/custom-events-color.md)
diff --git a/docs/api/template/event_date.md b/docs/api/template/event_date.md
index 05ee4869..51d75bc7 100644
--- a/docs/api/template/event_date.md
+++ b/docs/api/template/event_date.md
@@ -23,7 +23,7 @@ description: "specifies the time part of the start and end dates of the event. M
~~~jsx
scheduler.templates.event_date = function(date){
- var formatFunc = scheduler.date.date_to_str(scheduler.config.hour_date);
+ const formatFunc = scheduler.date.date_to_str(scheduler.config.hour_date);
return formatFunc(date);
}
~~~
diff --git a/docs/api/template/event_text.md b/docs/api/template/event_text.md
index 3c89be25..cd69abbd 100644
--- a/docs/api/template/event_text.md
+++ b/docs/api/template/event_text.md
@@ -14,20 +14,19 @@ description: "specifies the event's text"
### Parameters
-- `start` - (required) *Date* - the date when an event is scheduled to begin
+- `start` - (required) *Date* - the date when an event is scheduled to begin
- `end` - (required) *Date* - the date when an event is scheduled to be completed
- `event` - (required) *object* - the event object
### Returns
-- ` text` - (string) - html text for rendering in the scheduler
+- `text` - (string) - HTML text for rendering in the Scheduler
### Example
~~~jsx
-scheduler.templates.event_text=function(start, end, event){
- return ""
- +event.text+"";
-}
+scheduler.templates.event_text = (start, end, event) => {
+ return `${event.text}`;
+};
~~~
**Applicable views:** [Day view](views/day.md), [Week view](views/week.md), [Units view](views/units.md)
@@ -37,7 +36,7 @@ scheduler.templates.event_text=function(start, end, event){
### Details
-Note that for Month and Timeline Views you need to use the [event_bar_text](api/template/event_bar_text.md) template to specify the event's text.
+Note that for Month and Timeline views you need to use the [`event_bar_text`](api/template/event_bar_text.md) template to specify the event's text.
### Related Guides
- [Day View Templates](views/day-view-templates.md)
diff --git a/docs/api/template/format_date.md b/docs/api/template/format_date.md
index 7f11374b..39f530a0 100644
--- a/docs/api/template/format_date.md
+++ b/docs/api/template/format_date.md
@@ -22,7 +22,7 @@ description: "сonverts date object to a date string. Used to send data back to
### Example
~~~jsx
-var dateToStr = scheduler.date.date_to_str("%Y-%m-%d %H:%i");
+const dateToStr = scheduler.date.date_to_str("%Y-%m-%d %H:%i");
scheduler.templates.format_date = function(date){
return dateToStr (date);
};
diff --git a/docs/api/template/load_format.md b/docs/api/template/load_format.md
index b326f9d5..a330c0af 100644
--- a/docs/api/template/load_format.md
+++ b/docs/api/template/load_format.md
@@ -23,7 +23,7 @@ description: "specifies the format of requests in the dynamic loading mode"
~~~jsx
scheduler.templates.load_format = function(date){
- var dateToStr_func = scheduler.date.date_to_str(scheduler.config.load_date);
+ const dateToStr_func = scheduler.date.date_to_str(scheduler.config.load_date);
return dateToStr_func(date);
}
diff --git a/docs/api/template/month_date.md b/docs/api/template/month_date.md
index ff956fa0..3bf3354c 100644
--- a/docs/api/template/month_date.md
+++ b/docs/api/template/month_date.md
@@ -23,7 +23,7 @@ description: "specifies the date in the header of the view"
~~~jsx
scheduler.templates.month_date = function(date){
- var dateToStr_func = scheduler.date.date_to_str(scheduler.config.month_date);
+ const dateToStr_func = scheduler.date.date_to_str(scheduler.config.month_date);
return dateToStr_func(date);
};
~~~
diff --git a/docs/api/template/month_day.md b/docs/api/template/month_day.md
index ef73218b..43f4d1d4 100644
--- a/docs/api/template/month_day.md
+++ b/docs/api/template/month_day.md
@@ -23,7 +23,7 @@ description: "specifies the format of the day in a cell"
~~~jsx
scheduler.templates.month_day = function(date){
- var dateToStr_func = scheduler.date.date_to_str(scheduler.config.month_day);
+ const dateToStr_func = scheduler.date.date_to_str(scheduler.config.month_day);
return dateToStr_func(date);
};
~~~
diff --git a/docs/api/template/parse_date.md b/docs/api/template/parse_date.md
index dba56cd3..a781c86b 100644
--- a/docs/api/template/parse_date.md
+++ b/docs/api/template/parse_date.md
@@ -22,8 +22,8 @@ description: "converts date string into a Date object"
### Example
~~~jsx
-var cfg = scheduler.config;
-var strToDate = scheduler.date.str_to_date(cfg.date_format, cfg.server_utc);
+const cfg = scheduler.config;
+const strToDate = scheduler.date.str_to_date(cfg.date_format, cfg.server_utc);
scheduler.templates.parse_date = function(date){
return strToDate (date);
diff --git a/docs/api/template/timelinename_second_scale_date.md b/docs/api/template/timelinename_second_scale_date.md
index 04d7cb36..2fc0c22a 100644
--- a/docs/api/template/timelinename_second_scale_date.md
+++ b/docs/api/template/timelinename_second_scale_date.md
@@ -26,8 +26,8 @@ description: "specifies items of the second X-Axis"
~~~jsx
scheduler.templates.timeline_second_scale_date = function(date){
- var timeline = scheduler.matrix.timeline;
- var func = scheduler.date.date_to_str(
+ const timeline = scheduler.matrix.timeline;
+ const func = scheduler.date.date_to_str(
(timeline.second_scale && timeline.second_scale.x_date)?
timeline.second_scale.x_date:scheduler.config.hour_date
);
diff --git a/docs/api/template/tooltip_date_format.md b/docs/api/template/tooltip_date_format.md
index d0e14ef8..f8c8dcbc 100644
--- a/docs/api/template/tooltip_date_format.md
+++ b/docs/api/template/tooltip_date_format.md
@@ -23,7 +23,7 @@ description: "specifies the format of start and end dates displayed in the toolt
~~~jsx
scheduler.templates.tooltip_date_format=function (date){
- var formatFunc = scheduler.date.date_to_str("%Y-%m-%d %H:%i");
+ const formatFunc = scheduler.date.date_to_str("%Y-%m-%d %H:%i");
return formatFunc(date);
}
~~~
diff --git a/docs/api/template/week_agenda_scale_date.md b/docs/api/template/week_agenda_scale_date.md
index ab729614..ff7279d6 100644
--- a/docs/api/template/week_agenda_scale_date.md
+++ b/docs/api/template/week_agenda_scale_date.md
@@ -26,7 +26,7 @@ description: "the date of a day cell of the view"
~~~jsx
scheduler.templates.week_agenda_scale_date = function(date) {
- var scale_date_format = scheduler.date.date_to_str("%l, %F %d");
+ const scale_date_format = scheduler.date.date_to_str("%l, %F %d");
return scale_date_format(date);
};
~~~
diff --git a/docs/api/template/week_scale_date.md b/docs/api/template/week_scale_date.md
index 05588d18..9d83bc4a 100644
--- a/docs/api/template/week_scale_date.md
+++ b/docs/api/template/week_scale_date.md
@@ -22,7 +22,7 @@ description: "specifies the date in the sub-header of the view"
### Example
~~~jsx
-var format = scheduler.date.date_to_str(scheduler.config.day_date);
+const format = scheduler.date.date_to_str(scheduler.config.day_date);
scheduler.templates.week_scale_date = function(date){
return format(date);
};
diff --git a/docs/api/template/xml_date.md b/docs/api/template/xml_date.md
index 9e889ba5..252c7c8e 100644
--- a/docs/api/template/xml_date.md
+++ b/docs/api/template/xml_date.md
@@ -24,8 +24,8 @@ The template is deprecated
### Example
~~~jsx
-var cfg = scheduler.config;
-var str_to_date = scheduler.date.str_to_date(cfg.xml_date, cfg.server_utc);
+const cfg = scheduler.config;
+const str_to_date = scheduler.date.str_to_date(cfg.xml_date, cfg.server_utc);
scheduler.templates.xml_date = function(date){
return str_to_date(date);
@@ -39,8 +39,8 @@ scheduler.templates.xml_date = function(date){
:::
~~~js
-var cfg = scheduler.config;
-var strToDate = scheduler.date.str_to_date(cfg.date_format, cfg.server_utc);
+const cfg = scheduler.config;
+const strToDate = scheduler.date.str_to_date(cfg.date_format, cfg.server_utc);
scheduler.templates.parse_date = function(date){
return strToDate (date);
diff --git a/docs/api/template/xml_format.md b/docs/api/template/xml_format.md
index 79e4e40a..de3f5885 100644
--- a/docs/api/template/xml_format.md
+++ b/docs/api/template/xml_format.md
@@ -24,8 +24,8 @@ The template is deprecated
### Example
~~~jsx
-var cfg = scheduler.config;
-var date_to_str = scheduler.date.date_to_str(cfg.xml_date, cfg.server_utc);
+const cfg = scheduler.config;
+const date_to_str = scheduler.date.date_to_str(cfg.xml_date, cfg.server_utc);
scheduler.templates.xml_format = function(date){
return date_to_str(date);
@@ -39,7 +39,7 @@ scheduler.templates.xml_format = function(date){
:::
~~~js
-var dateToStr = scheduler.date.date_to_str("%Y-%m-%d %H:%i");
+const dateToStr = scheduler.date.date_to_str("%Y-%m-%d %H:%i");
scheduler.templates.format_date = function(date){
return dateToStr (date);
};
diff --git a/docs/api/template/year_date.md b/docs/api/template/year_date.md
index a0288c12..4b3aa5d2 100644
--- a/docs/api/template/year_date.md
+++ b/docs/api/template/year_date.md
@@ -22,7 +22,7 @@ description: "specifies the date in the header of the view"
### Example
~~~jsx
-var date_to_str=scheduler.date.date_to_str(scheduler.locale.labels.year_tab +" %Y");
+const date_to_str = scheduler.date.date_to_str(scheduler.locale.labels.year_tab +" %Y");
scheduler.templates.year_date = function(date){
return date_to_str(date);
diff --git a/docs/export/excel.md b/docs/export/excel.md
index 9a9f3bed..666a7684 100644
--- a/docs/export/excel.md
+++ b/docs/export/excel.md
@@ -9,14 +9,14 @@ Starting from version 4.2, dhtmlxScheduler provides a possibility to export all
## Limits on request size
-There is a common API endpoint **https://export.dhtmlx.com/scheduler** which serves for export methods (*exportToPDF*, *exportToPNG*, etc.). **Max request size is 10 MB**.
+There is a common API endpoint `https://export.dhtmlx.com/scheduler` which serves for export methods (*exportToPDF*, *exportToPNG*, etc.). **Max request size is 10 MB**.
## Export to Excel
To export scheduler's data to an Excel document, do the following steps:
-1. Include the "https://export.dhtmlx.com/scheduler/api.js" file on the page to enable the online export service:
+1. Include the `https://export.dhtmlx.com/scheduler/api.js` file on the page to enable the online export service:
~~~html
/*!*/
@@ -27,7 +27,7 @@ To export scheduler's data to an Excel document, do the following steps:
/*!*/
~~~
@@ -49,7 +49,7 @@ The **exportToExcel()** method takes as a parameter an object with several prope
server
-
(string) sets the API endpoint for the request. Can be used with the local install of the export service. The default value is https://export.dhtmlx.com/scheduler
+
(string) sets the API endpoint for the request. Can be used with the local install of the export service. The default value is `https://export.dhtmlx.com/scheduler`
start
@@ -63,7 +63,7 @@ The **exportToExcel()** method takes as a parameter an object with several prope
-[Calling the export method with optional properties](Calling the export method with optional properties)
+Calling the export method with optional properties:
~~~js
scheduler.exportToExcel({
name:"My document.xls",
@@ -73,7 +73,7 @@ scheduler.exportToExcel({
],
server:"https://myapp.com/myexport/scheduler",
start: new Date(1999, 01, 01),
- end: new Date(2022, 01, 01)
+ end: new Date(2027, 01, 01)
});
~~~
@@ -93,7 +93,7 @@ See the date format specification [here](guides/settings-format.md).
To export scheduler's data to an iCal string, do the following steps:
-- Include the "https://export.dhtmlx.com/scheduler/api.js" file on the page to enable the online export service:
+- Include the `https://export.dhtmlx.com/scheduler/api.js` file on the page to enable the online export service:
~~~html
@@ -107,7 +107,7 @@ To export scheduler's data to an iCal string, do the following steps:
/*!*/
~~~
@@ -121,13 +121,13 @@ The **exportToICal()** method takes as a parameter an object with the following
server
-
(string) sets the API endpoint for the request. Can be used with the local install of the export service. The default value is https://export.dhtmlx.com/scheduler
+
(string) sets the API endpoint for the request. Can be used with the local install of the export service. The default value is `https://export.dhtmlx.com/scheduler`
-[Calling the export method with optional properties](Calling the export method with optional properties)
+Calling the export method with server property:
~~~js
scheduler.exportToICal({
server:"https://myapp.com/myexport/scheduler"
diff --git a/docs/export/pdf-multi.md b/docs/export/pdf-multi.md
index d85a022d..e1997461 100644
--- a/docs/export/pdf-multi.md
+++ b/docs/export/pdf-multi.md
@@ -28,13 +28,13 @@ scheduler.toPDFRange(from, to, view, path, scheme);
4. '_custom_' - can be used to enable a custom colormap ( requires php coding, see details in chapter ['Export to PDF. Configuring service'](export/pdf.md#using-export-services)
5. '_fullcolor_' - actual background and text colors that are used while exporting
-For example, to export pages of the 'week' view from 1st January, 2012 till 1st February, 2012, you may call the method as in:
+For example, to export pages of the 'week' view from 1st January, 2027 till 1st February, 2027, you may call the method as in:
~~~js
scheduler.toPDFRange(
- new Date(2012,0,1),
- new Date(2012, 1,1),
+ new Date(2027,0,1),
+ new Date(2027, 1,1),
'week',
'generate.php',
'fullcolor'
diff --git a/docs/export/pdf.md b/docs/export/pdf.md
index 3a733f8c..3a900df4 100644
--- a/docs/export/pdf.md
+++ b/docs/export/pdf.md
@@ -8,8 +8,7 @@ sidebar_label: "Export to PDF"
*The article refers to exporting of dhtmlxScheduler 4.1+. If you use dhtmlxScheduler 4.0 or earlier versions, see details [here](export/pdf-legacy.md).*
-Starting from version 4.1, dhtmlxScheduler provides a new approach for exporting the scheduler into the PDF format -
-an [online export service](export/pdf.md#default-export-to-pdf).
+Starting from version 4.1, dhtmlxScheduler provides a new approach for exporting the scheduler into the PDF format: an [online export service](export/pdf.md#default-export-to-pdf).
:::info
@@ -21,49 +20,50 @@ during the valid support period (12 months for all PRO licenses).
There are several export services available. You can install them on your computer and export Scheduler to PDF locally.
-Note that export services are not included into the Scheduler package,
+Note that export services are not included in the Scheduler package,
read the [corresponding article](https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml) to learn the terms of using each of them.
## Limits on request size
-There is a common API endpoint *https://export.dhtmlx.com/scheduler* which serves for export methods (*exportToPDF*, *exportToPNG*, etc.). **Max request size is 10 MB**.
+There is a common API endpoint `https://export.dhtmlx.com/scheduler` that serves export methods such as `exportToPDF()` and `exportToPNG()`. Max request size is 10 MB.
## Default Export to PDF
To export a scheduler as a PDF document, complete the following steps:
-- To use the online export service, enable the export_api plugin via the [plugins](api/method/plugins.md) method:
+- To use the online export service, enable the `export_api` plugin via the [`plugins()`](api/method/plugins.md) method:
~~~js
scheduler.plugins({
- export_api: true
+ export_api: true
});
~~~
:::note
-If you use the Scheduler version older than 7.0, you need to include the **https://export.dhtmlx.com/scheduler/api.js** file on your page to enable the online export service, e.g.:
+If you use the Scheduler version older than 7.0, you need to include the `https://export.dhtmlx.com/scheduler/api.js` file on your page to enable the online export service, e.g.:
-~~~js
+~~~html
~~~
:::
-- Call the exportToPDF method to export Scheduler:
+- Call the [`exportToPDF()`](#parameters-of-the-export-method) method to export Scheduler:
-~~~html
-/*!*/
+~~~html {1}
+
~~~
-[Export to PDF/PNG](https://docs.dhtmlx.com/scheduler/samples/04_export/06_online_export.html)
+### Related samples
+- [Export to PDF/PNG](https://docs.dhtmlx.com/scheduler/samples/04_export/06_online_export.html)
## Parameters of the export method
-The [exportToPDF()](api/method/exporttopdf.md) method takes as a parameter an object with a number of properties (all of the properties are optional):
+The [`exportToPDF()`](api/method/exporttopdf.md) method takes an object with a number of properties as a parameter. All of the properties are optional:
@@ -94,7 +94,7 @@ The [exportToPDF()](api/method/exporttopdf.md) method takes as a parameter an ob
server
-
(string) sets the API endpoint for the request. Can be used with the local install of the export service. The default value is https://export.dhtmlx.com/scheduler
+
(string) sets the API endpoint for the request. Can be used with the local install of the export service. The default value is `https://export.dhtmlx.com/scheduler`
additional_settings
@@ -103,45 +103,44 @@ The [exportToPDF()](api/method/exporttopdf.md) method takes as a parameter an ob
-
-[Calling the export method with optional properties](Calling the export method with optional properties)
+### Calling the export method with optional properties
~~~js
scheduler.exportToPDF({
- name:"myscheduler.pdf",
- format:"A4",
- orientation:"portrait",
- zoom:1,
- header:"
",
+ server: "https://myapp.com/myexport/scheduler"
});
~~~
## Name of the output file
-To set a custom name for the output file, use the **name** property in the in the parameter of the [exportToPDF](export/pdf.md#parameters-of-the-export-method) method:
+To set a custom name for the output file, use the `name` property in the parameter of the [`exportToPDF()`](export/pdf.md#parameters-of-the-export-method) method:
-~~~js
+~~~js {2}
scheduler.exportToPDF({
- name:"my_beautiful_scheduler.pdf"/*!*/
+ name: "my_beautiful_scheduler.pdf"
});
~~~
## Header/footer of the output file
-To add a header/footer to the output PDF file, use the **header**/**footer** properties in the parameter of the [exportToPDF](export/pdf.md#parameters-of-the-export-method) method:
+To add a header/footer to the output PDF file, use the `header`/`footer` properties in the parameter of the [`exportToPDF()`](export/pdf.md#parameters-of-the-export-method) method:
:::note
Note, you can use any HTML while specifying the parameters. While specifying images, remember that you need to set global paths as values of the "src" attribute.
:::
-~~~js
+~~~js {3-4}
scheduler.exportToPDF({
- name:"myscheduler.pdf",
- header:"
My company
",/*!*/
- footer:"
Bottom line
"/*!*/
+ name: "myscheduler.pdf",
+ header: "
My company
",
+ footer: "
Bottom line
"
});
~~~
@@ -152,34 +151,34 @@ To apply a custom style for the scheduler, provide the stylesheet with your cust
- through a link:
-~~~js
+~~~js {3}
scheduler.exportToPDF({
- name:"calendar.pdf",
- header:'' /*!*/
+ name: "calendar.pdf",
+ header: ''
});
~~~
- or through the 'style' tag:
-~~~js
+~~~js {3}
scheduler.exportToPDF({
- name:"calendar.pdf",
- header:'' /*!*/
+ name: "calendar.pdf",
+ header: ''
});
~~~
-Note, the aforementioned solution works for the global HTTP reference. If you have CSS classes specified in an Intranet/local environment, you can embed all styles as in:
+Note, the aforementioned solution works for the global HTTP reference. If you have CSS classes specified in an intranet/local environment, you can embed all styles as follows:
~~~js
scheduler.exportToPDF({
- header:""
+ header: ""
});
~~~
## Exporting HTML elements
-While exporting the Scheduler to the PDF format, you should note that export of HTML elements is limited due to their possible insecurity.
+While exporting the Scheduler to the PDF format, note that export of HTML elements is limited due to their possible insecurity.
There are HTML elements which are not entirely allowed for export, such as `