Return to the menu   Select another DES Module

Demonstrates the Current Date Label when showing multiple selections

The Current Date Label shows the current selected date. When there are multiple selections, you can show the lowest and highest date of the selection and the total count of dates.

All properties to customize it are found on the MultiSelectionCalendar.CurrentDateLabels property. They include:

  • ShowField - Activates and positions this field.
  • LabelWithNoSelection – The text shown when there are no dates selected.
  • LabelWithOneSelection – The text shown when there is one date selected. The token “{DATE}” is replaced by the first date, using DateFormat to determine the date format.When it is "", nothing is shown.
    It defaults to “{DATE}”.
  • LabelWithMultipleSelections – The text shown when there are multiple dates selected. It supports HTML.
    The token “{FIRSTDATE}” will be replaced by the first date.
    The token “{LASTDATE}” will be replaced by the last selected date.
    The token “{COUNT}” is replaced by the number of dates selected.
    It defaults to “{COUNT} selected”.
  • DateFormat - The token {DATE} uses this to format its date.
  • DateFormatWithMultipleSelections – When using the LabelWithMultipleSelections, the tokens "{FIRSTDATE}" and "{LASTDATE}" use this to format the date. It allows the date to be much shorter than the format supplied by DateFormat.


Controls

Select any dates

Previous Month
Next Month
January 2025 Select a Different Month
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678
No selection
Click on dates to toggle their selection.


Select only one week

Previous Month
Next Month
January 2025 Select a Different Month
SunMonTueWedThuFriSat
>2930311234
>567891011
>12131415161718
>19202122232425
>2627282930311
>2345678
Click on dates to toggle their selection.

Source Code (C#)

<h2>Select any dates</h2>
<des:MultiSelectionCalendar ID="MultiSelectionCalendar1" runat="server">
   <CurrentDateLabels ShowField="RecommendedRow"  
      LabelWithMultipleSelections="{COUNT} selections in {FIRSTDATE} to {LASTDATE}" 
      DateFormatWithMultipleSelections="AbbreviatedNoYear" LabelWithNoSelection="No selection" />
</des:MultiSelectionCalendar>
<br/><br/>
<h2>Select only one week</h2>
<des:MultiSelectionCalendar runat="server" ID="MultiSelectionCalendar2" 
   SelectWeeks="true" SelectSingleDates="false" 
   UnselectOthersFirst="true" >
   <CurrentDateLabels LabelWithMultipleSelections="{FIRSTDATE} to {LASTDATE}" 
      DateFormatWithMultipleSelections=Abbreviated ShowField=FooterRow1 />
</des:MultiSelectionCalendar>

Return to the menu   Select another DES Module