ComponentOne Input for ASP.NET AJAX: Using C1DateInput > Defining C1DateInput

Defining C1DateInput

You can define the date pattern through the visual designers, for example, the C1DateInput Smart Tag or the C1DateInput Designer, or programmatically through the C1DateInput object.

When the user edits the date at run time, note the following:

      Formatted fields represented in string form, such as month or day of the week in Long date pattern, can be typed as numbers on the keyboard and their string representation is updated automatically.

      UP/DOWN ARROWS can be used to increase/decrease the current field.

C1DateInput General Properties

The following table lists general properties of the C1DateInput control:

 

Property

Description

Date

DateTime value.

DateFormat

Date format pattern or date format character (preset character).

DateFormatResultPattern

Resulting date format pattern that depends on the culture (only get).

NullText

Text that will be displayed for null date.

ShowNullText

Show null text if the Date value is empty and the control loses its focus.

WebCalendar

Gets or sets the C1WebCalendar control to interact with the C1DateInput control.

C1DateInput Format Characters

The C1DateInput format characters are case-sensitive. The following table lists standard format characters:

 

Preset Pattern

Name

d

Short date pattern

D

Long date pattern

t

Short time pattern

T

Long time pattern

F

Full date/time pattern(short time)

g

General date/time pattern (short time)

G

General date/time pattern (long time)

U

Universal sortable date/time pattern

C1DateInput Format Patterns

The C1DateInput patterns are case-sensitive. The following table lists standard patterns:

 

Format Pattern

Description

d

The day of the month. Single-digit days will not have a leading zero.

dd

Two-digit day of the month. Single-digit days will have a leading zero.

ddd

The abbreviated name of the day of the week.

dddd

The full name of the day of the week.

M

The numeric month. Single-digit months will not have a leading zero.

MM

The numeric month. Single-digit months will have a leading zero.

MMM

The abbreviated name of the month.

MMMM

The full name of the month.

y

The year without the century. If the year without the century is less than 10, the year is displayed with no leading zero.

yy

The year without the century. If the year without the century is less than 10, the year is displayed with a leading zero.

yyyy

Four-digit year (0000 through 9999).

h

The hour in a 12-hour clock. Single-digit hours will not have a leading zero.

hh

The hour in a 12-hour clock. Single-digit hours will have a leading zero.

H

The hour in a 24-hour clock. Single-digit hours will not have a leading zero.

HH

The hour in a 24-hour clock. Single-digit hours will have a leading zero.

m

The minute. Single-digit minutes will not have a leading zero.

mm

The minute. Single-digit minutes will have a leading zero.

s

The second. Single-digit seconds will not have a leading zero.

ss

The second. Single-digit seconds will have a leading zero.

t

The first character in the AM/PM designator.

tt

The AM/PM designator.

 

Note: If characters in pattern are enclosed in single quotation marks then these characters are treated as literals. For example, pattern: 'dd:' dd.MM.yyyy for date 03.07.2006 outputs string "dd: 03.07.2006".


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.