Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Calendar control
  • Overview
  • Control in a window or page
  • Creating a Calendar control
  • Describing the Calendar control
  • Translating the elements of a Calendar control
  • Translating the "Today"/"Preset period" button
  • Translating days and months in the Calendar control
  • Translate the context menu of the Calendar control
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures

Control in a window or page

The Calendar control is used to permanently display a calendar in a window or page. This calendar can display the current date, or interact with the window or page (e.g., by displaying the schedule corresponding to the selected day).
Android Use conditions: To use a Calendar control in Android, the "Android Support Library V4" extension must be present on the development computer when generating the Android application. The setup procedure of this extension is available at the following address:

Creating a Calendar control

To create a Calendar control:
  1. On the "Creation" tab, in the "Graphic controls" group:
    • WINDEVWEBDEV - Server code expand "Time" and select "Calendar".
    • WINDEV Mobile click "Calendar".
  2. Click where the control will be created in the window or page. The control appears in the editor.
To view the characteristics of the control, select "Description" in the context menu.
Describing the Calendar control
The Calendar control can be customized in the editor via the description window.
Here are some features of the Calendar control. You can:
  • define a date range ("Lower bound" and "Upper bound" in the "General" tab of the description window).
  • define a background image:
    • WINDEV "General" tab of the description window.
    • WEBDEV - Server code "Style" tab of the description window, "Background image" element.
  • define the characteristics of the calendar ("Details" tab of the description window):
    • first day of the week,
    • show week number (it is possible to use a numbering that comply with the ISO 8601 standard).
    • display format of the month,
    • multi-selection calendar (not available in WEBDEV, PHP, iPhone, iPad),
    • presence of a "Today" button.
  • define the style of all the elements displayed in the calendar ("Style" tab). To define the style of an element, simply click its label ("Sunday" for example).
  • change the image of the "Next" and "Previous" buttons ("Style" tab, "Next/Previous buttons" element).
Translating the elements of a Calendar control

Translating the "Today"/"Preset period" button

The "Today" and "Preset period" buttons can be translated in the calendar description window ("Details" tab).

Translating days and months in the Calendar control

To translate the days and months displayed in the Calendar control, you must set the project language options:
  1. Open the project description: on the "Project" tab, in the "Project" group, click "Description".
  2. In the "Languages" tab, select the desired language.
  3. In the options of the selected language, go to the "Date" tab and select "Use the following parameters".
  4. Click "Days and Months" and enter the translations, if necessary. Validate.
  5. Validate the project description window.

Translate the context menu of the Calendar control

When you select a time period in a Calendar control, a context menu appears. By default, the context menu of the Calendar control is available in English and French.
To translate the context menu of the Calendar control into another language, the IW_WINDEVAafMenu_Date window must be added to your project.
To add the context menu of a Calendar control to your project:
  1. On the "Project" tab, in the "Project" group, expand "Import" and select "WINDEV elements and their dependencies".
  2. Select the subdirectory that contains the elements to import. The context menu of the calendar is located in the "\Programs\Data\Preset Windows\EN\AAF" subdirectory of the WINDEV installation directory.
  3. WINDEV lists the elements of the directory. This directory contains the different elements corresponding to the customizable AAFs. To customize the Calendar control, select "IW_WINDEVAafMenu_Date".
  4. Validate. The internal window is included in the project.
  • The window must not be renamed.
  • If this window is included in your application, you may not benefit from the improvements made to this window during the different updates. Don't forget to check whether this window has evolved.
  • Caution: To modify this window, the corresponding file must not be read-only. Modify the characteristics of the file in Windows if necessary.
To customize the context menu of the calendar:
  1. Display the "IW_WinDevAafMenu_Date" window.
  2. In the "UI" tab, click the button to the right of "Context menu". Select "Edit this context menu".
  3. The context menu appears in the editor. For example, you can translate the various options into the desired language.
Linux You cannot select a period in Linux. The context menu of the calendar is not available.
Related Examples:
The Calendar control Unit examples (WINDEV): The Calendar control
[ + ] Four methods for using the Calendar control:
- Using the Calendar control found in the WINDEV toolbar
- Using CalendarOpen and CalendarPicker as well as CalendarSelect (multi-selection)
- Using ..CalendarButton
- Using BankHolidayAdd
Minimum version required
  • Version 14
This page is also available for…
Click [Add] to post a comment

Last update: 09/06/2023

Send a report | Local help