AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Desarrollar una aplicación o un sitio web / Controles, ventanas y páginas / Controles: tipos disponibles / Control Calendario
  • Overview
  • Management of public holidays
  • Managing multi-selection
  • Retrieve the multi-selection
  • Managing the selection of a time period
  • WLanguage functions
  • Functions for managing bank holidays
  • Calendar control functions
  • Properties specific to Calendar controls
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Overview
WINDEV, WEBDEV and WINDEV Mobile allow you to manipulate a Calendar control programmatically. 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 "Formato almacenado: " control found in the "General" tab of the control description. This variable is a string.
Calendar controls can be manipulated programmatically:
The Calendar control is associated with several WLanguage processes.
Remarks:
  • You can also manipulate a day of a Calendar control programmatically. 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.
Management of 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 public holidays to 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
WINDEVAndroidJava

Retrieve the multi-selection

A Calendar control can be multi-select: the Calendar control can then be used to select several dates.. To do so, simply check " Selección múltiple" in the "Details" tab of the control description. You can also use the Multi-selection property.
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_ CalendarSelectOccurrence(CAL_Calendar1)
Trace(CalendarSelect(CAL_Calendar1, I))
END
WINDEVAndroidJava

Managing the selection of a time period

A Calendar control can be used to select a period: the Calendar control can then be used to select the start and end dates of the period.. The days found between these two dates are automatically selected.
To allow the selection of a time period, " Selección de período" must be checked in the "Details" tab of the control description window.
To select a period, simply click directly in the Calendar control: the first click selects the period start date, the second click selects the period end date..

WINDEVAndroidJava If the "Today" button is displayed ("Details" tab of the description window), the context menu of this button proposes preset periods. The user can easily select the requested period.
To get the start and end date of the selected time period, simply use the StartDate and EndDate WLanguage properties.
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 bank holidays:
BankHolidayIndica si un día es festivo o no.
BankHolidayAddIndica que un día (o una lista de días) es un día festivo.
BankHolidayDeleteAllBorra la lista de todos los días festivos.

Calendar control functions

The following functions are used to manage the Calendar control:
CalendarPositionReturns the month displayed in a Calendar control.
CalendarSelectDevuelve la fecha seleccionada en un control Calendario.
CalendarSelectCountDevuelve el número de días seleccionados en un control Calendario.
CalendarSelectMinusAnula la selección de una fecha en un control Calendario multiselección.
CalendarSelectPlusSelecciona una fecha en un control Calendario.
Properties specific to Calendar controls
The following properties are specific to programmed Calendar control.
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 Calendar controls, see Calendar control properties.
Versión mínima requerida
  • Versión 14
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 30/09/2024

Señalar un error o enviar una sugerencia | Ayuda local