CalendarControl



Outlook.com is a free personal email service from Microsoft that doesn't scan your email for the purpose of serving you ads. Automatically file emails and share photos easily. Calendar Control v1.1.0 DatePickerOnly v2 - DatePicker Popup Advanced Positioning It is a simple change in the DatPicker form: The window appears near the clicked cell, and never out of the screen. Regardless of the Application or the Active Window is maximized or moved away or maximized. Calendar Control v1.1.0 - with simple DatePicker Popup Form!

The Calendar control allows you to select date and time from a calendar. You can configure the Picker Type property of the control to use Date , Time or Date and Time . See the Date and Time Use Cases section for information on which one to use.

Try it yourself!

See the following resources for more information:

  • See How To: Create an Exchange Appointment Form for an example of customizing the control's Picker Type property.
Configuring the Control
  1. Create a view.
  2. Drag the control onto the canvas. You can find the control in the Input section of the Toolbox.
  3. Configure the Picker Type property.
  4. Configure the rest of the properties as necessary.
  5. Run the view.
Date and Time Use Cases

Use the information below to determine where and when to use the following data types:

  • DateTime - Allows you to specify a Coordinated Universal Time (UTC) that shows the time in the local timezone.
    • DateTime (with timezone) - Allows you to use a UTC time that does not vary based on the local timezone, see configuring a time zone
  • Date - You can use this for a timezone-invariant date (no time).
  • Time - You can use this for a timezone-invariant time (no date).

When you click on the ellipsis next to the Picker Type property, the Configure Picker Type page opens. Select the options you need based on the preview and your scenario.

Calendar
FieldsDescription
Date
First day of weekThe day to start the week for your organization. User Settings uses the default value of your browser culture. Alternatively, select a day from the list.
Time
Time Format The way time is shown. The following options are available:
  • Long time
  • Short time
  • hh:mm:ss:tt
  • hh:mm:tt
  • hh tt
  • HH:mm:ss
  • HH:mm
  • HH
See Time Format Setting below for more details and examples.
Minute interval Adjust the minute interval by using the up and down arrows. The following intervals are available:
  • 1
  • 5
  • 10
  • 15
  • 20
  • 30
Setting an interval does not limit what you can manually type in the field.
Second interval Adjust the second interval by using the up and down arrows. The following intervals are available:
  • 1
  • 2
  • 5
  • 10
  • 15
  • 20
  • 30
Setting an interval does not limit what you can manually type in the field.
Reset
ResetResets the values to the default date and intervals.

Time Format Setting

The control allows you to have a 12 hour (AM/PM) or 24 hour clock displayed in the picker. This is useful when you have customers in different countries with different culture settings. There are three items to consider when you use the Calendar picker as they work together and influence the display of the picker and control:

  • Picker Type property - Determines the format of the Date and Time to display in the Calendar picker and whether to display it as a 12 hour (AM/PM) or 24 hour clock.
  • Date and Time format applied to the control - Determines the display of the value in the control.
  • Browser culture - Determines the format of the Long time and Short time.

When you use the Time Format option of the Picker Type property you have the following options:

  • Long time - Displays either as hh:mm:ss tt or HH:mm:ss depending on whether the culture of the control as configured on the Format page has a default 12 hour or 24 hour clock configured
  • Short time - Displays either as hh:mm tt or HH:mm depending on whether the culture of the control as configured on the Format page has a default 12 hour or 24h clock
  • hh:mm:ss tt - Displays as a 12 hour clock
  • hh:mm tt - Displays as a 12 hour clock
  • hh tt - Displays as a 12 hour clock
  • HH:mm:ss - Displays as a 24 hour clock
  • HH:mm - Displays as a 24 hour clock
  • HH - Displays as a 24 hour clock

Explanation of the notations:

h = hour
m = minute
s = second
tt = AM/PM
h/H = 12/24 hour

The Calendar picker icon shows the type of picker you select when you configure the control. Depending on the type of picker, you can configure a date and time. The time displays according to the Date/Time culture settings used in respect of a 12-hour or 24-hour clock. Specify a time by clicking on the hours, minutes or seconds, then use the up and down arrows. The time intervals apply according to the intervals you configure for the picker. Alternatively, type the required hours, minutes or seconds. For more detail see the Picker Type

The examples below show the different time formats based on the Time Format settings that you configure:

CalendarControlProperties

You can find the control in the Input section of the Toolbox.

PropertiesDescriptionCan be set in runtime?
Detail
NameA unique identifier for the selected control. This property is required and defaults to the name of the control. Yes, see SmartForm controls extensibility for more information.
Default Value

Populates the initial value of the control in runtime. Use one of the following values:

  • Empty
  • Today (Current Date)
  • Now (Date and Time)
Yes, see Configure the Set a Control's Properties Action for more information.
FieldThe field bound to the control. See the Binding Fields to Controls section for more information on how to use it.No
Data TypeA drop-down list containing the types of values that the control can accept. See the Date/Time Use Cases section. No
WatermarkThe text to display when the control is not populated. Yes, see Configure the Set a Control's Properties Action for more information.
Tooltip

The value to display when the cursor hovers over the control.

Yes, see Configure the Set a Control's Properties Action for more information.
Settings
Picker TypeEnables you to configure the control to use Date , Time or Date and Time . These settings apply when you click on the Calendar picker in runtime.No
General
WidthAdjusts the width of the control. You can enter any whole percentage up to 100%, whole number, or pixel value (maximum of 32767px). Yes, see Configure the Set a Control's Properties Action for more information.
Defines a sequence that users follow when they use the Tab key to navigate through a page at runtime. Yes, see Configure the Set a Control's Properties Action for more information.
VisibleShows or hides the control. Yes, see Configure the Set a Control's Properties Action for more information.
EnabledEnables or disables the control. If the control is disabled, you won't be able to use it. Yes, see Configure the Set a Control's Properties Action for more information.
Read-OnlyShows the control as read-only. Yes, see Configure the Set a Control's Properties Action for more information.
Opens the Expression Builderto configure expressions to populate the control with dynamically calculated values. Yes, see Configure the Set a Control's Properties Action for more information.
Format Opens the Format page where you can configure formatting and style features such as format, font, borders, padding and margins. See the Format topic for more information. No
Conditional Format Opens the Conditional Formatting page. You can add conditional formatting to apply a specific format or style when a condition you set is True. Use conditional format on its own or with the Format feature. See Conditional Format for more information. Click the ellipsis to open the Conditional Formatting page. No
Considerations
  • The control is also available when you use forms
  • You can use Date and Time expressions on the control to dynamically calculate dates, days of the week, start and end of a quarter, and more
  • You can use the Transfer data rule action to transfer values to and from the control. You can use static text, values from another control, or system values from the Context Browser
  • The Date and Time Format settings determine the display value of the date and time
  • When you apply a Date and Time format using the Format property, it is important to keep the format in sync with the settings of the Picker Type property to ensure correct expected behavior. For example, when you use Full date/time format on the Format page and you select the Time option in the Picker Type property, the value displays in Full date/time format, but when you click on the Calendar picker, you can only edit the time
  • When you select Date and Time or Time in the Picker Type property, the Time value in the picker shows either a 12-hour or 24-hour clock picker depending on the culture settings
  • You can use the Focus control method in the Rule Designer to set focus to the control in runtime
  • The control does not support validation on manual input when the form is offline. You can use the calendar picker in offline mode
  • You can use the control with forms saved as a draft in the K2 Workspace (Mobile) app to save the data on the form to resume at a later point or to work on the form while offline. See How To: Configure Forms with Draft Functionality, Drafts in Android and Building SmartForms for Mobile Devices for more information on saving a form as a draft in the K2 Workspace (Mobile) apps.

Calendar Control Allegheny County

-->

A month calendar control implements a calendar-like user interface. This provides the user with a very intuitive and recognizable method of entering or selecting a date. The control also provides the application with the means to obtain and set the date information in the control using existing data types.

  • Month Calendar Control Features

Month Calendar Control Features

The following screen shot shows a month calendar control that has been sized to show two months.

Note

The appearance and behavior of the month calendar control differs slightly under different versions of the run-time library. This topic focuses on the control as it appears in Windows Vista with version 6 of Comctl32.dll.

The control in the illustration has the following optional features.

  • The current date is shown on a separate line at the bottom of the control. This is the default style.
  • The 'today circle' (actually a rectangle in this version) appears around the current day, and beside the 'Today' line as a visual cue. This is the default style.
  • Week numbers are shown at the left of each row of days. This style must be specified.
  • Some dates are shown in bold, according to the day state set by the application. For example, dates that have scheduled meetings might be shown in bold. This style must be specified.

Note

Windows does not support dates prior to 1601. See FILETIME for details.

The month-calendar control is based on the Gregorian calendar, which was introduced in 1753. It will not calculate dates that are consistent with the Julian calendar that was in use prior to 1753.

Selecting a day

By default, when a user clicks the arrow buttons in the top left or top right of the month calendar control, the control updates its display to show the previous or next month. The user can also perform the same action by clicking the partial months displayed before the first month and after the last month.

The following keyboard commands can also be used to move the selection. The calendar always scrolls as necessary to display the selected day. (The virtual key codes are shown in the table.)

Left arrow (VK_LEFT)Select the previous day.
Right arrow (VK_RIGHT)Select the next day.
Up arrow (VK_UP)Select the same day in the previous week.
Down arrow (VK_DOWN)Select the same day in the next week.
PAGE UP (VK_PRIOR)Select the same day in the previous month. (If that month does not have the day, the closest day is selected; for example, the selection moves from March 31 to February 28 or 29.)
PAGE DOWN (VK_NEXT)Select the same day in the next month.
HOME (VK_HOME)Select the first day of the current month.
END (VK_END)Select the last day of the current month.
CTRL + HOMEScroll one month backward and select a day in the leftmost column.
CTRL + ENDScroll one month forward and select a day in the rightmost column.
CTRL + PAGE UPSelect the same day in an earlier month. The number of months by which the selection moves is the number of months displayed in the control. For example, if two months are displayed, the selection would move from June 6 to May 6.
CTRL + PAGE DOWNSelect the same day in an earlier month. The number of months by which the selection moves is the number of months displayed in the control. For example, if two months are displayed, the selection would move from June 6 to August 6.

If a month calendar control is not using the MCS_NOTODAY style, the user can return to the current day by clicking the 'Today' text at the bottom of the control. If the current day is not visible, the control updates its display to show it.

An application can change the number of months by which the control updates its display by using the MCM_SETMONTHDELTA message or the corresponding macro, MonthCal_SetMonthDelta. However, the PAGE UP and PAGE DOWN keys change the selected month by one, regardless of the number of months displayed or the value set by MCM_SETMONTHDELTA.

Selecting a nonadjacent month

When a user clicks the name of a displayed month, all months in the year are listed (in earlier versions, this is a pop-up menu). The user can select a month on the list. If the user's selection is not visible, the month calendar control scrolls its display to show the chosen month. In the following screen shot, a month calendar control shows the months of two adjacent years.

CalendarControl

Selecting a different year

Microsoft Calendar Control

Microsoft calendar control

Ms Access Calendar Control

If the user clicks the year, a group of years is listed, and the user can select a different one, as shown in the following screen shot.

Localization

The month-calendar control gets its format and all strings from LOCALE_USER_DEFAULT.

Javascript Calendar Control

Times in the Month Calendar Control

The month calendar control does not display the time. However, the SYSTEMTIME structure that is used to set and retrieve the selected date or today's date contains time fields. When a date is set programmatically, the control either copies the time fields as they are or validates them first and then, if they are invalid, stores the current default times. Following is a list of the messages that set a date and a description of how the time fields are treated.

Access Calendar Control

MCM_SETCURSELThe control copies the time fields as they are, without validation or modification.
MCM_SETRANGEThe time fields of the structures passed in are validated. If they are valid, the time fields are copied without modification. If they are invalid, the control copies the time fields from today's data.
MCM_SETSELRANGEThe time fields of the structures passed in are validated. If they are valid, the time fields are copied without modification. If they are invalid, the control retains the time fields from the current selection ranges.
MCM_SETTODAYThe control copies the time fields as they are, without validation or modification.

Calendar Control In Excel

When a date is retrieved from the control, the time fields will be copied from the stored times without modification. Handling of the time fields by the control is provided as a convenience to the programmer. The control does not examine or modify the time fields as a result of any operation other than those listed above.





Comments are closed.