Popup Calendar 1.0 - DHTML Lab | 11 | WebReference

Popup Calendar 1.0 - DHTML Lab | 11


Logo

Pop-up Calendar 1.0
The Calendar Attributes, Part 3



 
date_format date_format = "MMM dd y"    [ Dec 03 04 ]
date_format = "mm dd yy"    [ 12 03 04 ]
date_format = "d/mm/yyyy"   [ 3/12/2004 ]
date_format = "yyyy-MMM-dd[ 2004-Dec-03 ]
...

Specifies the date display format used for displaying a date selected by the user in a text input or textarea element.

This parameter is required only if you give a value to the input_element_id parameter.

Any ordering of d, dd, MMM, mmm, yy and yyyy and any delimiter between them is valid. In detail:

d The date is displayed without a leading 0 for single-digit dates.
"3" is displayed as 3
"24" is displayed as 24
dd The date is displayed with a leading 0 for single-digit dates.
"3" is displayed as 03
"24" is displayed as 24
m The month is displayed as a number without a leading 0 for single-digit months.
"April" is displayed as 4
"December" is displayed as 12
mm The month is displayed as a number with a leading 0 for single-digit months.
"April" is displayed as 04
"December" is displayed as 12
M
MM
MMM
MMMM+
The month is displayed as a string. The length of the string depends on the number of Ms specified.
The string displayed is extracted from the month names you have defined in the months parameter.
If you have specified Apr as the display for "April" in months, then:
M will create a display of A
MM will create a display of Ap
MMM will create a display of Apr
y
yy
The year is displayed in two-digit form with a leading 0 if required.
"2004" is displayed as 04
"1999" is displayed as 99
yyy
yyyy
The year is displayed in full four-digit form.
"2004" is displayed as 2004
"1999" is displayed as 1999

The script provides a default date_format value of MMM-dd-yyyy.

 
start_date   start_date = "2004-12-03"
start_date = "2004,12,03"

Specifies a date before which the user may not navigate.

Dates falling before the start date are disabled and greyed out by default.

Values must be in numeric four-digit-year, one-or-two-digit-month, one-or-two-digit-date format, delimited by either a dash or a comma.

The script does not provide a default start_date value.

Usage Suggestion:
Set to restrict the user's choice of dates, as for online-booking which can only be in the future.

 
end_date   end_date = "2004-12-03"
end_date = "2004,12,03"

Specifies a date after which the user may not navigate.

Dates falling after the end date are disabled and greyed out by default.

Values must be in numeric four-digit-year, one-or-two-digit-month, one-or-two-digit-date format, delimited by either a dash or a comma.

The script does not provide a default end_date value.

Usage Suggestion:
Set to restrict the user's choice of dates, as for online-booking which usually pertains to the current season.

 
root_date   root_date = "2004-12-03"
root_date = "2004,12,03"

Specifies a date that the calendar will display upon first use.

Values must be in numeric four-digit-year, one-or-two-digit-month, one-or-two-digit-date format, delimited by either a dash or a comma.

The script does not provide a default root_date value. The current date is used.

Usage Suggestion:
Set to direct the user's choice of dates around a date relevant to the web page's content. For example, if a web page displays television listings for a particular date, then the user should continue navigating from that date, not today's date.

On the next page: specifying the "click" and input elements.



Send a comment or suggestion to Peter Belesis

Created: July 20, 2004
Revised: July 20, 2004

URL: http://webreference.com/dhtml/column67/7.html