Skip to content

Commit

Permalink
Merge pull request #1 from DHTMLX/next
Browse files Browse the repository at this point in the history
Next
  • Loading branch information
serhiipylypchuk1991 authored Oct 31, 2023
2 parents 6281629 + e9b739b commit 53265c1
Show file tree
Hide file tree
Showing 9 changed files with 260 additions and 81 deletions.
1 change: 1 addition & 0 deletions docs/api/api_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ new eventCalendar.EventCalendar("#root", {
| [](api/config/js_eventcalendar_config_config.md) | @getshort(api/config/js_eventcalendar_config_config.md) |
| [](api/config/js_eventcalendar_date_config.md) | @getshort(api/config/js_eventcalendar_date_config.md) |
| [](api/config/js_eventcalendar_editorshape_config.md)| @getshort(api/config/js_eventcalendar_editorshape_config.md)|
| [](api/config/js_eventcalendar_editorvalidation_config.md)| @getshort(api/config/js_eventcalendar_editorvalidation_config.md)|
| [](api/config/js_eventcalendar_events_config.md) | @getshort(api/config/js_eventcalendar_events_config.md) |
| [](api/config/js_eventcalendar_locale_config.md) | @getshort(api/config/js_eventcalendar_locale_config.md) |
| [](api/config/js_eventcalendar_mode_config.md) | @getshort(api/config/js_eventcalendar_mode_config.md) |
Expand Down
37 changes: 37 additions & 0 deletions docs/api/config/js_eventcalendar_editorvalidation_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
sidebar_label: editorValidation
title: mode Config
description: You can learn about the editorValidation config 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.
---

# mode

### Description

@short: Optional. A callback that returns and applies validation rules to editor fields

### Usage

~~~jsx {}
editorValidation?: (event: object) => string | false;
~~~

### Parameters

The callback function takes an object with the event data:

- `event` - the event data object

### Example

~~~jsx {3-5}
// create Event Calendar
new eventCalendar.EventCalendar("#root", {
editorValidation: event => {
if (!event.text) return "Text is required";
}
// other configuration parameters
});
~~~

**Change log:** The ***editorValidation*** property was added in v2.1.3
5 changes: 5 additions & 0 deletions docs/api/config/js_eventcalendar_events_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ If the **allDay** parameter is set to *true*, the **start_date** and **end_date*
:::

- `id` - (optional) an ID of the event

:::info
If there are multiple events with the same **id**, the calendar will drop an error as soon as it finds a duplicated **id**. It is expected that each event has its own unique **id**, or that the **id** is not specified (and then the calendar will generate its own **id**).
:::

- `type` - (optional) a type (calendar) of the event
- `text` - (optional) a label of the event
- `details` - (optional) details of the event
Expand Down
1 change: 1 addition & 0 deletions docs/api/overview/properties_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ description: You can explore a properties overview in the documentation of the D
| [](../config/js_eventcalendar_config_config.md) | @getshort(../config/js_eventcalendar_config_config.md) |
| [](../config/js_eventcalendar_date_config.md) | @getshort(../config/js_eventcalendar_date_config.md) |
| [](../config/js_eventcalendar_editorshape_config.md)| @getshort(../config/js_eventcalendar_editorshape_config.md)|
| [](../config/js_eventcalendar_editorvalidation_config.md)| @getshort(../config/js_eventcalendar_editorvalidation_config.md)|
| [](../config/js_eventcalendar_events_config.md) | @getshort(../config/js_eventcalendar_events_config.md) |
| [](../config/js_eventcalendar_locale_config.md) | @getshort(../config/js_eventcalendar_locale_config.md) |
| [](../config/js_eventcalendar_mode_config.md) | @getshort(../config/js_eventcalendar_mode_config.md) |
Expand Down
17 changes: 16 additions & 1 deletion docs/guides/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ You can configure the *Event Calendar* appearance and functionality via correspo

- configure the timetable grid via the [`config`](api/config/js_eventcalendar_config_config.md) property
- configure the editor fields via the [`editorShape`](api/config/js_eventcalendar_editorshape_config.md) property
- configure validation of the editor fields via the [`editorValidation`](api/config/js_eventcalendar_editorvalidation_config.md) property
- set the initial sidebar state via the [`sidebar`](api/config/js_eventcalendar_sidebar_config.md) property
- set the initial view mode via the [`mode`](api/config/js_eventcalendar_mode_config.md) property
- set the initial theme via the [`theme`](api/config/js_eventcalendar_theme_config.md) property
Expand Down Expand Up @@ -482,6 +483,20 @@ new eventCalendar.EventCalendar("#root", {
Unless you specify the editor settings via the [`editorShape`](api/config/js_eventcalendar_editorshape_config.md) property, the widget will apply a [**defaultEditorShape**](api/config/js_eventcalendar_editorshape_config.md#default-config) set of parameters!
:::

### Editor fields validation

To validate data entered into editor fields, you can use the [`editorValidation`](api/config/js_eventcalendar_editorvalidation_config.md) property. See the example below for more details:

~~~jsx {3-5}
// create Event Calendar
new eventCalendar.EventCalendar("#root", {
editorValidation: event => {
if (!event.text) return "Text is required";
}
// other configuration parameters
});
~~~

## Sidebar

To configure a sidebar state, you can use the [`sidebar`](api/config/js_eventcalendar_sidebar_config.md) property. There are 3 available states:
Expand Down Expand Up @@ -566,4 +581,4 @@ new eventCalendar.EventCalendar("#root", {

In this snippet you can see how to configure Event Calendar:

<iframe src="https://snippet.dhtmlx.com/qw45r367?mode=result&tag=event_calendar" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>
<iframe src="https://snippet.dhtmlx.com/qw45r367?mode=result&tag=event_calendar" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>
251 changes: 171 additions & 80 deletions docs/guides/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,69 @@ The **English** locale is used by default:
const en = {
dateFnsLocale: dateFnsLocaleEn,
eventCalendar: { // translations of the Event Calendar labels
"Add description": "Add description",
"All day": "All day",
"Create event": "Create event",
"Delete event": "Delete event",
"Edit event": "Edit event",
"End date": "End date",
"Event name": "Event name",
"New Event": "New Event",
"Start date": "Start date",
Add: "Add",
Calendar: "Calendar",
Calendars: "Calendars",
Color: "Color",
confirmDelete: "Are you sure you want to delete this event?",
confirmUnsaved: "You have unsaved changes! Do you want to discard them?",
Day: "Day",
Delete: "Delete",
Description: "Description",
Edit: "Edit",
Month: "Month",
Name: "Name",
New: "New",
Save: "Save",
Today: "Today",
Type: "Type",
Week: "Week",
// time and date settings
dateFormat: "EEE, d",
hourFormat: "H",
minuteFormat: "mm",
monthFormat: "EEE",
timeFormat: 12 // 24
"Add description": "Add description",
"Create event": "Create event",
"Edit event": "Edit event",
"Delete event": "Delete event",
"Event name": "Event name",
"Start date": "Start date",
"End date": "End date",
"All day": "All day",
"No events": "No events",
Type: "Type",
Description: "Description",
Today: "Today",
Day: "Day",
Week: "Week",
Month: "Month",
Timeline: "Timeline",
Calendars: "Calendars",
hourFormat: "H",
minuteFormat: "mm",
monthFormat: "EEE",
dateFormat: "EEE, d",
agendaDateFormat: "MMMM d EEEE",
unassignFormat: "d MMM yyyy",
Color: "Color",
Delete: "Delete",
Edit: "Edit",
Calendar: "Calendar",
New: "New",
Name: "Name",
Save: "Save",
Add: "Add",
Event: "Event",
confirmDelete: "Are you sure you want to delete {item}?",
confirmUnsaved:
"You have unsaved changes! Do you want to discard them?",
"Repeat event": "Repeat event",
viewAll: "+{count} more",
Never: "Never",
Every: "Every",
Workdays: "On work days",
Year: "Year",
Custom: "Custom",
Ends: "Ends",
After: "After",
"On date": "On date",
events: "events",
"recurring event": "recurring event",
all: "All events",
future: "This and following events",
only: "This event",

recurringActionError:
"Start date cannot be after recurrent expiry date",

Assignees: "Assignees",
"Recurring events": "Recurring events",
"Single events": "Single events",

recurringEveryMonthDay: "Every {date}",
recurringEveryMonthPos: "Every {pos} {weekDay}",
recurringEveryYearDay: "Every {date} of {month}",
recurringEveryYearPos: "Every {pos} {weekDay} of {month}"
},
calendar: { // translations and settings of the calendar
monthFull: [
Expand Down Expand Up @@ -113,38 +144,67 @@ Besides the ***en*** locale, Event Calendar also includes the built-in ***de***
const de = {
dateFnsLocale: dateFnsLocaleDe,
eventCalendar: { // translations of the Event Calendar labels
"New Event": "Neuer Eintrag",
"Add description": "Beschreibung",
"All day": "Den ganzen Tag",
"Create event": "Neuer Eintrag",
"Delete event": "Löschen",
"Edit event": "Ändern",
"End date": "Ende",
"Delete event": "Löschen",
"Event name": "Name",
"New Event": "Neuer Eintrag",
"Start date": "Start",
Add: "Hinzufügen",
Calendar: "Kalender",
"End date": "Ende",
"All day": "Den ganzen Tag",
"No events": "Keine Ereignisse",
Type: "Typ",
Description: "Beschreibung",
Today: "Heute",
Day: "Tag",
Week: "Woche",
Month: "Monat",
Year: "Jahr",
Timeline: "Zeitleiste",
Agenda: "Agenda",
Calendars: "Kalender",
hourFormat: "H",
minuteFormat: "mm",
monthFormat: "EEE",
dateFormat: "EEE, d",
agendaDateFormat: "MMMM d EEEE",
unassignFormat: "d MMM yyyy",
Color: "Farbe",
confirmDelete: "Der Eintrag wird gelöscht",
confirmUnsaved: "Du hast nicht gespeicherte Änderungen! Möchten Sie sie verwerfen?",
Day: "Tag",
Delete: "Löschen",
Description: "Beschreibung",
Edit: "Ändern",
Month: "Monat",
Name: "Name",
Calendar: "Kalender",
New: "Neuer",
Name: "Name",
Save: "Speichern",
Today: "Heute",
Type: "Typ",
Week: "Woche",
// time and date settings
dateFormat: "EEE, d",
minuteFormat: "mm",
monthFormat: "EEE",
hourFormat: "H",
timeFormat: 24 // 12
Add: "Hinzufügen",
Event: "Eintrag",
confirmDelete: "Möchten Sie {item} wirklich löschen?",
confirmUnsaved:
"Du hast nicht gespeicherte Änderungen! Möchten Sie sie verwerfen?",
"Repeat event": "Ereignis wiederholen",
viewAll: "+{count} mehr",
Never: "Niemals",
Every: "Jeden",
Workdays: "An Werktagen",
After: "Nach",
"On date": "Am tag",
events: "veranstaltungen",
"recurring event": "wiederkehrendes ereignis",
all: "Alle ereignis",
future: "Diese und folgende ereignis",
only: "Diese ereigni",

recurringActionError:
"Das Startdatum darf nicht nach dem wiederkehrenden Ablaufdatum liegen",

Assignees: "Abtretungsempfänger",
"Recurring events": "Wiederkehrende ereignisse",
"Single events": "Einzelereignisse",
recurringEveryMonthDay: "Jedes {date}",
recurringEveryMonthPos: "Jeden {pos} {weekDay}",
recurringEveryYearDay: "Jedes {date} von {month}",
recurringEveryYearPos: "Jeden {pos} {weekDay} von {month}",
},
calendar: { // translations and settings of the calendar
monthFull:[
Expand Down Expand Up @@ -189,38 +249,69 @@ const de = {
const ru = {
dateFnsLocale: dateFnsLocaleRu,
eventCalendar: { // translations of the Event Calendar labels
"Add description": "Описание",
"All day": "Весь день",
"Create event": "Создать событие",
"Delete event": "Удалить",
"Edit event": "Редактировать",
"End date": "Дата окончания",
"Event name": "Название",
"Start date": "Дата начала",
"New Event": "Новое событие",
Add: "Добавить",
Calendar: "Календарь",
Calendars: "Календари",
Color: "Цвет",
confirmDelete: "Вы уверены, что хотите удалить это событие?",
confirmUnsaved: "У вас есть несохраненные изменения! Вы действительно хотите отменить их?",
Day: "День",
Delete: "Удалить",
Description: "Описание",
Edit: "Редактировать",
Month: "Месяц",
Name: "Имя",
New: "Новый",
Save: "Сохранить",
Today: "Сегодня",
Type: "Тип",
Week: "Неделя",
// time and date settings
dateFormat: "EEE, d",
"Add description": "Описание",
"Create event": "Создать событие",
"Edit event": "Редактировать",
"Delete event": "Удалить",
"Event name": "Название",
"Start date": "Дата начала",
"End date": "Дата окончания",
"All day": "Весь день",
"No events": "Нет событий",
Type: "Тип",
Description: "Описание",
Today: "Сегодня",
Day: "День",
Week: "Неделя",
Month: "Месяц",
Year: "Год",
Agenda: "Расписание",
Timeline: "График",
Calendars: "Календари",
hourFormat: "H",
minuteFormat: "mm",
monthFormat: "EEE",
timeFormat: 24,
dateFormat: "EEE, d",
agendaDateFormat: "MMMM d EEEE",
unassignFormat: "d MMM yyyy",
Color: "Цвет",
Delete: "Удалить",
Edit: "Редактировать",
Calendar: "Календарь",
New: "Новый",
Name: "Имя",
Save: "Сохранить",
Add: "Добавить",
Event: "Событие",
confirmDelete: "Вы действительно хотите удалить {item}?",
confirmUnsaved:
"У вас есть несохраненные изменения! Вы действительно хотите отменить их?",
"Repeat event": "Повотрять событие",
viewAll: "Ещё {count}",
Never: "Никогда",
Every: "Каждый",
Workdays: "По будним дням",
Custom: "Другое",
Ends: "Заканчивается",
After: "После",
"On date": "Дата",
events: "событий",
"recurring event": "повторяющееся событие",
all: "Все события",
future: "Это и последующие события",
only: "Только это событие",

recurringActionError:
"Начало события не может быть установлено после даты завершения повторяющегося события",

Assignees: "Относится",
"Recurring events": "Повторяющиеся события",
"Single events": "Одиночные события",
recurringEveryMonthDay: "Каждое {date} число",
recurringEveryMonthPos: "Каждый {pos} {weekDay}",
recurringEveryYearDay: "Каждое {date} число {month}",
recurringEveryYearPos: "Каждый {pos} {weekDay} {month}",
},
calendar: { // translations and settings of the calendar
monthFull: [
Expand Down
Loading

0 comments on commit 53265c1

Please sign in to comment.