PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
New WINDEV, WEBDEV, WINDEV Mobile 23 feature!
  • Overview
  • Managing bank holidays
  • Managing the multi-selection
  • Multi-selection
  • Managing the selection of a period
  • WLanguage functions
  • Functions for managing bank holidays
  • Functions for managing the Calendar control
  • Properties specific to Calendar controls
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
WINDEV, WEBDEV and WINDEV Mobile allow you to handle a Calendar control by programming. To do so, use the variable of Calendar control in the code.
The variable of 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 is using the format specified in the "Stored format" control found in the "General" tab of control description. This variable is a string.
The Calendar control can be handled by programming:
The Calendar control is associated with several WLanguage processes.
Notes:
  • You also have the ability to handle a day of a Calendar control by programming. See Managing the calendar days for more details.
  • WINDEV, WEBDEV and WINDEV Mobile automatically manage the change of month or the change of year performed by the user.
Versions 15 and later
Java The Calendar control is now available for the Java applications.
New in version 15
Java The Calendar control is now available for the Java applications.
Java The Calendar control is now available for the Java applications.
Versions 18 and later
iPhone/iPad The Calendar control is now available for the iPhone/iPad applications.
Android The Calendar control is now available for the Android applications.
WINDEVLinux The Calendar control is now available for the WINDEV applications in Linux.
New in version 18
iPhone/iPad The Calendar control is now available for the iPhone/iPad applications.
Android The Calendar control is now available for the Android applications.
WINDEVLinux The Calendar control is now available for the WINDEV applications in Linux.
iPhone/iPad The Calendar control is now available for the iPhone/iPad applications.
Android The Calendar control is now available for the Android applications.
WINDEVLinux The Calendar control is now available for the WINDEV applications in Linux.
Versions 21 and later
Universal Windows 10 App The Calendar control is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App The Calendar control is now available in Universal Windows 10 App mode.
Universal Windows 10 App The Calendar control is now available in Universal Windows 10 App mode.
Managing bank holidays
The bank holidays are managed by programming. Several WLanguage functions (starting with BankHolidayXXX) are available.
BankHolidayAdd is used to define the bank holidays displayed in a calendar. This function allows you to define the list of bank holidays that will be used. This function allows you to customize the bank holidays according to the country and to the 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 bank holidays
BankHolidayDeleteAll()
// Initialize the 11 bank holidays common to the French regions and to the French 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 bank holidays for the regions of Moselle and Alsace
BankHolidayAdd("1226" + CR + bhGoodFriday)
Managing the multi-selection
WINDEVAndroidWindows MobileUniversal Windows 10 AppJava

Multi-selection

A calendar can be multi-selection: the calendar allows you to select several dates. To do so, "Multi-selection" must be checked in the "Details" tab of the description window of the control. You also have the ability to use ..Multiselection.
To retrieve the selected dates, all you have to do is use the CalendarXXX functions of WLanguage.
Example:
// Browse the dates selected in the Calendar control
FOR I = 1 _TO_ CAL_Calendar1.SelectOccurrence()
Trace(CAL_Calendar1.Select(I))
END
WINDEVAndroidWindows MobileUniversal Windows 10 AppJava

Managing the selection of a period

A calendar can propose the selection of a period: the calendar allows you to select the start date and the end date of period. The days found between these two dates are automatically selected.
To allow the selection of a period, "Period selection" must be checked in the "Details" tab of the description window of control.
At run time, to select a period, all you have to do is click the Calendar control: the first click is used to select the start date of period, the second click is used to select the end date of period.
WINDEVAndroidUniversal Windows 10 AppJava If the "Today" button is displayed ("Details" tab of description window), the popup menu of this button proposes preset periods. The user can easily select the requested period.
To retrieve the start date and the end date of selected period, all you have to do is use ..StartDate and ..EndDate.
Example:
NbDays is int
NbDays = DateDifference(CAL_Calendar1..StartDate, CAL_Calendar1..EndDate) + 1
Info("Selected period: from " + DateToString(CAL_Calendar1..StartDate) + ...
" to " + DateToString(CAL_Calendar1..EndDate) + ...
" which means " + NbDays + " day(s)")
WLanguage functions

Functions for managing bank holidays

The following functions are used to manage the bank holidays:
Versions 14 and later
BankHoliday
New in version 14
BankHoliday
BankHoliday
Indicates whether a day is a bank holiday or not.
Versions 14 and later
BankHolidayAdd
New in version 14
BankHolidayAdd
BankHolidayAdd
Indicates that a day (or a list of days) is a bank holiday.
Versions 14 and later
BankHolidayDeleteAll
New in version 14
BankHolidayDeleteAll
BankHolidayDeleteAll
Clears the list of all bank holidays.

Functions for managing the Calendar control

The following functions are used to manage the Calendar control:
Versions 14 and later
<Calendar>.Position
New in version 14
<Calendar>.Position
<Calendar>.Position
Returns the month displayed in a Calendar control.
Versions 14 and later
<Calendar>.Select
New in version 14
<Calendar>.Select
<Calendar>.Select
Returns the date selected in a Calendar control.
Versions 14 and later
<Calendar>.SelectMinus
New in version 14
<Calendar>.SelectMinus
<Calendar>.SelectMinus
Deselects a date in a multi-selection Calendar control.
Versions 14 and later
<Calendar>.SelectOccurrence
<Calendar>.SelectOccurrence
Returns the number of days selected in a Calendar control.
Versions 14 and later
<Calendar>.SelectPlus
New in version 14
<Calendar>.SelectPlus
<Calendar>.SelectPlus
Selects a date in a Calendar control.
Properties specific to Calendar controls
The following properties are used to manage a Calendar control by programming.
MaxValueAllows you to find out and modify the upper bound of Calendar control.
MinValueAllows you to find out and modify the lower bound of Calendar control.
StartDateAllows you to find out and modify the start date of a period selected in a Calendar control.
EndDateAllows you to find out and modify the end date of a period selected in a Calendar control.
MemoryFormatAllows you to find out and modify the format of the value returned by the Calendar control.
ImageAllows you to find out and modify the background image of Calendar control.
MultiselectionUsed to find out and modify the selection mode of a Calendar control
To find out the entire list of WLanguage properties that can be used with a Calendar control, see Properties associated with the Calendar control.
Minimum required version
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment