PHP 클래스 Prado\Web\UI\WebControls\TDatePicker

TDatePicker displays a text box for date input purpose. When the text box receives focus, a calendar will pop up and users can pick up from it a date that will be automatically entered into the text box. The format of the date string displayed in the text box is determined by the DateFormat property. Valid formats are the combination of the following tokens, Character Format Pattern (en-US) ----------------------------------------- d day digit dd padded day digit e.g. 01, 02 M month digit MM padded month digit MMMM localized month name, e.g. March, April yy 2 digit year yyyy 4 digit year ----------------------------------------- TDatePicker has four Mode to show the date picker popup. # Basic -- Only shows a text input, focusing on the input shows the date picker. This way you can access the popup using only the keyboard. Note that because of this, TAB-bing through this control will automatically select the current date if no previous date was selected. If you close the popup (eg. pressing the ESC key) you'll need to un-focus and re-focus the control again for the popup to reappear. # Clickable -- Only shows a text input, clicking on the input shows the date picker. This mode solves the two small problems of the Basic mode. It was first introduced in Prado 3.2. # Button -- Shows a button next to the text input, clicking on the button shows the date, button text can be by the ButtonText property # ImageButton -- Shows an image next to the text input, clicking on the image shows the date picker, image source can be change through the ButtonImageUrl property. The CssClass property can be used to override the css class name for the date picker panel. CalendarStyle property sets the packages styles available. E.g. default. The InputMode property can be set to "TextBox" or "DropDownList" with default as "TextBox". In DropDownList mode, in addition to the popup date picker, three drop down list (day, month and year) are presented to select the date . The PositionMode property can be set to "Top" or "Bottom" with default as "Bottom". It specifies the position of the calendar popup, relative to the input field.
부터: 3.0
저자: Carl G. Mathisen ([email protected])
상속: extends TTextBox
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

공개 메소드들

메소드 설명
getButtonImageUrl ( ) : string
getButtonText ( ) : string
getCalendarStyle ( ) : string
getClientSide ( ) : TDatePickerClientScript Gets the TDatePickerClientScript to set the TDatePicker event handlers.
getCulture ( ) : string Gets the current culture.
getData ( ) : integer Returns the timestamp selected by the user.
getDate ( ) : string
getDateFormat ( ) : string
getFirstDayOfWeek ( ) : integer
getFromYear ( ) : integer
getInputMode ( ) : TDatePickerInputMode
getMode ( ) : TDatePickerMode
getPositionMode ( ) : TDatePickerPositionMode
getShowCalendar ( ) : boolean
getTimeStamp ( ) : integer
getUpToYear ( ) : integer
getValidationPropertyValue ( ) : integer Returns the value to be validated.
loadPostData ( $key, $values ) : boolean Loads user input data. Override parent implementation, when InputMode is DropDownList call getDateFromPostData to get date data.
onPreRender ( $param ) Publish the date picker Css asset files.
render ( $writer ) Renders body content.
setAutoPostBack ( $value ) AutoPostBack is not supported.
setButtonImageUrl ( $value )
setButtonText ( $value )
setCalendarStyle ( $value )
setCulture ( $value ) Sets the culture/language for the date picker.
setData ( $value ) Sets the timestamp represented by this control.
setDate ( $value )
setDateFormat ( $value ) Sets the format of the date string.
setFirstDayOfWeek ( $value ) Set the first day of week, with 0 as Sunday, 1 as Monday, etc.
setFromYear ( $value )
setInputMode ( $value )
setMode ( $value )
setPositionMode ( $value )
setShowCalendar ( $value ) Sets whether to pop up the calendar window when the control receives focus
setTimeStamp ( $value ) Sets the date for the date picker using timestamp.
setUpToYear ( $value )

보호된 메소드들

메소드 설명
addAttributesToRender ( $writer ) Add the client id to the input textbox, and register the client scripts.
createClientScript ( ) : TDatePickerClientScript
getAssetUrl ( $file = '' ) : string
getCulturalOptions ( ) : array Get javascript localization options, e.g. month and weekday names.
getCurrentCulture ( ) : string
getDateFromPostData ( $key, $values ) : array Loads date from drop down list data.
getDatePickerButtonID ( ) : string Gets the ID for the date picker trigger button.
getDatePickerOptions ( ) : array Get javascript date picker options.
getDropDownDayOptions ( ) : array
getLocalizedCalendarInfo ( ) : DateTimeFormatInfo
getLocalizedMonthNames ( $info ) : array Returns the localized month names that depends on the month format pattern.
getTimeStampFromText ( ) : integer Gets the date from the text input using TSimpleDateFormatter
hasDayPattern ( )
publishCalendarStyle ( ) : string Publish the calendar style Css asset file.
registerCalendarClientScriptPre ( ) Registers the javascript code to initialize the date picker.
renderButtonDatePicker ( $writer ) : THtmlWriter Adds an additional button such that when clicked it shows the date picker.
renderCalendarDayOptions ( $writer, $selected = null ) Renders the day drop down list options.
renderCalendarMonthOptions ( $writer, $selected = null ) Renders the month drop down list options.
renderCalendarSelections ( $writer, $date ) Renders the calendar drop down list depending on the DateFormat pattern.
renderCalendarYearOptions ( $writer, $selected = null ) Renders the year drop down list options.
renderClientControlScript ( $writer )
renderDatePickerButtons ( $writer ) Renders the date picker popup buttons.
renderDropDownListCalendar ( $writer ) Renders the drop down list date picker.
renderImageButtonDatePicker ( $writer ) : THtmlWriter Adds an additional image button such that when clicked it shows the date picker.

비공개 메소드들

메소드 설명
renderDropDownListOptions ( $writer, $options, $selected = null ) Renders a drop down lists.

메소드 상세

addAttributesToRender() 보호된 메소드

Add the client id to the input textbox, and register the client scripts.
protected addAttributesToRender ( $writer )

createClientScript() 보호된 메소드

protected createClientScript ( ) : TDatePickerClientScript
리턴 TDatePickerClientScript javascript validator event options.

getAssetUrl() 보호된 메소드

protected getAssetUrl ( $file = '' ) : string
리턴 string date picker asset url.

getButtonImageUrl() 공개 메소드

public getButtonImageUrl ( ) : string
리턴 string the image url for "Image" UI mode.

getButtonText() 공개 메소드

public getButtonText ( ) : string
리턴 string text for the date picker button. Default is "...".

getCalendarStyle() 공개 메소드

public getCalendarStyle ( ) : string
리턴 string current calendar style

getClientSide() 공개 메소드

The date picker on the client-side supports the following events. # OnDateChanged -- raised when the date is changed. You can attach custom javascript code to each of these events
public getClientSide ( ) : TDatePickerClientScript
리턴 TDatePickerClientScript javascript validator event options.

getCulturalOptions() 보호된 메소드

Get javascript localization options, e.g. month and weekday names.
protected getCulturalOptions ( ) : array
리턴 array localization options.

getCulture() 공개 메소드

Gets the current culture.
public getCulture ( ) : string
리턴 string current culture, e.g. en_AU.

getCurrentCulture() 보호된 메소드

protected getCurrentCulture ( ) : string
리턴 string the current culture, falls back to application if culture is not set.

getData() 공개 메소드

This method is required by {@link \Prado\IDataRenderer}. It is the same as {@link getTimeStamp()}.
또한 보기: getTimeStamp
부터: 3.1.2
public getData ( ) : integer
리턴 integer the timestamp of the TDatePicker control.

getDate() 공개 메소드

public getDate ( ) : string
리턴 string the date string.

getDateFormat() 공개 메소드

public getDateFormat ( ) : string
리턴 string the format of the date string

getDateFromPostData() 보호된 메소드

Loads date from drop down list data.
protected getDateFromPostData ( $key, $values ) : array
리턴 array the date selected

getDatePickerButtonID() 보호된 메소드

Gets the ID for the date picker trigger button.
protected getDatePickerButtonID ( ) : string
리턴 string unique button ID

getDatePickerOptions() 보호된 메소드

Get javascript date picker options.
protected getDatePickerOptions ( ) : array
리턴 array date picker client-side options

getDropDownDayOptions() 보호된 메소드

protected getDropDownDayOptions ( ) : array
리턴 array list of day options for a drop down list.

getFirstDayOfWeek() 공개 메소드

public getFirstDayOfWeek ( ) : integer
리턴 integer first day of the week

getFromYear() 공개 메소드

public getFromYear ( ) : integer
리턴 integer date picker starting year, default is -5 years

getInputMode() 공개 메소드

public getInputMode ( ) : TDatePickerInputMode
리턴 TDatePickerInputMode input method of date values. Defaults to TDatePickerInputMode::TextBox.

getLocalizedCalendarInfo() 보호된 메소드

protected getLocalizedCalendarInfo ( ) : DateTimeFormatInfo
리턴 DateTimeFormatInfo date time format information for the current culture.

getLocalizedMonthNames() 보호된 메소드

"MMMM" will return the month names, "MM" or "MMM" return abbr. month names and "M" return month digits.
protected getLocalizedMonthNames ( $info ) : array
리턴 array localized month names.

getMode() 공개 메소드

public getMode ( ) : TDatePickerMode
리턴 TDatePickerMode current calendar UI mode.

getPositionMode() 공개 메소드

public getPositionMode ( ) : TDatePickerPositionMode
리턴 TDatePickerPositionMode current calendar UI position.

getShowCalendar() 공개 메소드

public getShowCalendar ( ) : boolean
리턴 boolean whether the calendar window should pop up when the control receives focus

getTimeStamp() 공개 메소드

public getTimeStamp ( ) : integer
리턴 integer current selected date from the date picker as timestamp, NULL if timestamp is not set previously.

getTimeStampFromText() 보호된 메소드

Gets the date from the text input using TSimpleDateFormatter
protected getTimeStampFromText ( ) : integer
리턴 integer current selected date timestamp

getUpToYear() 공개 메소드

public getUpToYear ( ) : integer
리턴 integer date picker ending year, default +10 years

getValidationPropertyValue() 공개 메소드

This methid is required by \Prado\Web\UI\IValidatable interface.
public getValidationPropertyValue ( ) : integer
리턴 integer the interger timestamp if valid, otherwise the original text.

hasDayPattern() 보호된 메소드

protected hasDayPattern ( )

loadPostData() 공개 메소드

This method is primarly used by framework developers.
public loadPostData ( $key, $values ) : boolean
리턴 boolean whether the data of the component has been changed

onPreRender() 공개 메소드

Publish the date picker Css asset files.
public onPreRender ( $param )

publishCalendarStyle() 보호된 메소드

Publish the calendar style Css asset file.
protected publishCalendarStyle ( ) : string
리턴 string Css file url.

registerCalendarClientScriptPre() 보호된 메소드

Registers the javascript code to initialize the date picker.

render() 공개 메소드

This method overrides parent implementation by adding additional date picker button if Mode is Button or ImageButton.
public render ( $writer )

renderButtonDatePicker() 보호된 메소드

Adds an additional button such that when clicked it shows the date picker.
protected renderButtonDatePicker ( $writer ) : THtmlWriter
리턴 THtmlWriter writer

renderCalendarDayOptions() 보호된 메소드

Renders the day drop down list options.
protected renderCalendarDayOptions ( $writer, $selected = null )

renderCalendarMonthOptions() 보호된 메소드

Renders the month drop down list options.
protected renderCalendarMonthOptions ( $writer, $selected = null )

renderCalendarSelections() 보호된 메소드

Renders the calendar drop down list depending on the DateFormat pattern.
protected renderCalendarSelections ( $writer, $date )

renderCalendarYearOptions() 보호된 메소드

Renders the year drop down list options.
protected renderCalendarYearOptions ( $writer, $selected = null )

renderClientControlScript() 보호된 메소드

protected renderClientControlScript ( $writer )

renderDatePickerButtons() 보호된 메소드

Renders the date picker popup buttons.
protected renderDatePickerButtons ( $writer )

renderDropDownListCalendar() 보호된 메소드

Renders the drop down list date picker.
protected renderDropDownListCalendar ( $writer )

renderImageButtonDatePicker() 보호된 메소드

Adds an additional image button such that when clicked it shows the date picker.
protected renderImageButtonDatePicker ( $writer ) : THtmlWriter
리턴 THtmlWriter writer

setAutoPostBack() 공개 메소드

AutoPostBack is not supported.
public setAutoPostBack ( $value )

setButtonImageUrl() 공개 메소드

public setButtonImageUrl ( $value )

setButtonText() 공개 메소드

public setButtonText ( $value )

setCalendarStyle() 공개 메소드

public setCalendarStyle ( $value )

setCulture() 공개 메소드

Sets the culture/language for the date picker.
public setCulture ( $value )

setData() 공개 메소드

This method is required by {@link \Prado\IDataRenderer}. It is the same as {@link setTimeStamp()}.
또한 보기: setTimeStamp
부터: 3.1.2
public setData ( $value )

setDate() 공개 메소드

public setDate ( $value )

setDateFormat() 공개 메소드

Sets the format of the date string.
public setDateFormat ( $value )

setFirstDayOfWeek() 공개 메소드

Set the first day of week, with 0 as Sunday, 1 as Monday, etc.
public setFirstDayOfWeek ( $value )

setFromYear() 공개 메소드

public setFromYear ( $value )

setInputMode() 공개 메소드

public setInputMode ( $value )

setMode() 공개 메소드

public setMode ( $value )

setPositionMode() 공개 메소드

public setPositionMode ( $value )

setShowCalendar() 공개 메소드

Sets whether to pop up the calendar window when the control receives focus
public setShowCalendar ( $value )

setTimeStamp() 공개 메소드

Sets the date for the date picker using timestamp.
public setTimeStamp ( $value )

setUpToYear() 공개 메소드

public setUpToYear ( $value )