ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Calendar control
  • Overview
  • Managing public holidays
  • Managing multi-selection
  • WLanguage functions
  • Functions for managing bank holidays
  • Calendar control functions
  • Properties specific to Calendar controls
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
WINDEV, WEBDEV and WINDEV Mobile allow you to handle a Calendar control through programming. To do so, use the variable of Calendar control in the code.
The variable of the Calendar control corresponds to the selected date (if the control is multi-selection or with period selection, the variable corresponds to the first selected date). This date uses the format specified in the "Stored format: " control found in the "General" tab of the control description. This variable is a string.
The Calendar control can be handled through programming:
The Calendar control is associated with several WLanguage processes.
Remarks:
  • You can also handle a day of a Calendar control through programming. For more details, see Managing the calendar days.
  • WINDEV, WEBDEV and WINDEV Mobile automatically manage the change of month or the change of year performed by the user.
Managing public holidays
Public holidays can be set programmatically. Several WLanguage functions (starting with BankHolidayXXX) are available.
BankHolidayAdd is used to define the bank holidays displayed in a Calendar control. This function allows you to define the list of bank holidays that will be used. This function allows you to customize the public holidays according to the country and local regulations. This function must be used at the beginning of the application because it has a global effect on the application.
Example:
// Delete all public holidays
BankHolidayDeleteAll()
// Initialize the 11 public holidays common to the French regions and territories
BankHolidayAdd("0101") // 1st of January
BankHolidayAdd(bhEasterMonday) // Easter Monday
BankHolidayAdd("0501") // 1st of May
BankHolidayAdd("0508") // 8th of May
BankHolidayAdd(bhAscensionDay) // Ascension day
BankHolidayAdd(bhWhitMonday) // Whit Monday
BankHolidayAdd("0714") // 14th of July
BankHolidayAdd("0815") // 15th of August (Assumption)
BankHolidayAdd("1101") // All Saints' Day
BankHolidayAdd("1111") // 11th of November
BankHolidayAdd("1225") // Christmas
 
// Add 2 additional public holidays for the regions of Moselle and Alsace
BankHolidayAdd("1226" + CR + bhGoodFriday)
Managing multi-selection
WLanguage functions

Functions for managing bank holidays

The following functions are used to manage bank holidays:
BankHolidayIndicates whether a day is a public holiday or not.
BankHolidayAddIndicates that a day (or a list of days) is a public holiday.
BankHolidayDeleteAllClears the list of all public holidays.

Calendar control functions

The following functions are used to manage the Calendar control:
CalendarPositionReturns the month displayed in a Calendar control.
CalendarSelectReturns the date selected in a Calendar control.
CalendarSelectCountReturns the number of days selected in a Calendar control.
CalendarSelectMinusDeselects a date in a multi-selection Calendar control.
CalendarSelectPlusSelects a date in a Calendar control.
Properties specific to Calendar controls
The following properties are used to manage a Calendar control by programming.
EndDateAllows you to get and change the end date of a time period selected in a Calendar control.
ImageAllows you to find out and modify the background image of Calendar control.
MaxValueAllows you to find out and modify the upper bound of Calendar control.
MemoryFormatAllows you to find out and modify the format of the value returned by the Calendar control.
MinValueAllows you to find out and modify the lower bound of Calendar control.
Multi-selectionUsed to find out and modify the selection mode of a Calendar control
StartDateAllows you to get and change the start date of a time period selected in a Calendar control.

For a complete list of WLanguage properties that can be used with a Calendar control, see Properties associated with Calendar controls.
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/26/2023

Send a report | Local help