Setting the Date Format Pattern and Date
The following example demonstrates how to set the date format pattern for the C1DateInput control.
To set the date format pattern using the Tasks menu:
1. Open the C1DateInput Tasks menu and click Designer. The C1DateInput Designer appears.
2. Choose a preformatted date pattern. For this example, select Long date pattern.
Notice that the designer shows the preview below.
3. Click OK.
4. With the Tasks menu still opened, click the Date drop-down arrow. The calendar appears.
5. Select the date selected for today's date.
To set the date format pattern using .html markup:
To display the Long date pattern format for the Date Format value, use the following markup in the .aspx page:
<cc1:C1DateInput ID="C1DateInput1" runat="server"
Date="2006-12-19"
DateFormat="D">
</cc1:C1DateInput>
To set the date format pattern using code:
To set the date format pattern for the C1DateInput control, double-click the Web page to create an event handler for the Load event. Enter the following code for the Page_Load event:
' Format the control as long date pattern
Me.C1DateInput1.DateFormat = "D"
' Set the date
Me.C1DateInput1.Date = "2006-12-19"
• C#
// Format the control as long date pattern
this.C1DateInput1.DateFormat = "D";
// Set the date
this.C1DateInput1.Date = DateTime.Parse("2006-12-19");
This topic illustrates the following:
Run the project and notice the date format pattern has been updated.
|