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.
Показать файл
Открыть проект
Примеры использования класса
Открытые методы
Защищенные методы
Приватные методы
Описание методов
addAttributesToRender()
защищенный Метод
Add the client id to the input textbox, and register the client scripts.
createClientScript()
защищенный Метод
protected createClientScript ( ) : TDatePickerClientScript |
Результат |
TDatePickerClientScript |
javascript validator event options. |
getAssetUrl()
защищенный Метод
getButtonText()
публичный Метод
getCalendarStyle()
публичный Метод
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.
getCulture()
публичный Метод
Gets the current culture.
getCurrentCulture()
защищенный Метод
getData()
публичный Метод
This method is required by {@link \Prado\IDataRenderer}.
It is the same as {@link getTimeStamp()}.
getDate()
публичный Метод
getDateFromPostData()
защищенный Метод
Loads date from drop down list data.
getDatePickerOptions()
защищенный Метод
Get javascript date picker options.
getDropDownDayOptions()
защищенный Метод
getFirstDayOfWeek()
публичный Метод
getFromYear()
публичный Метод
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.
getMode()
публичный Метод
public getMode ( ) : TDatePickerMode |
Результат |
TDatePickerMode |
current calendar UI mode. |
getPositionMode()
публичный Метод
public getPositionMode ( ) : TDatePickerPositionMode |
Результат |
TDatePickerPositionMode |
current calendar UI position. |
getShowCalendar()
публичный Метод
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
getUpToYear()
публичный Метод
getValidationPropertyValue()
публичный Метод
This methid is required by \Prado\Web\UI\IValidatable interface.
hasDayPattern()
защищенный Метод
loadPostData()
публичный Метод
This method is primarly used by framework developers.
onPreRender()
публичный Метод
Publish the date picker Css asset files.
publishCalendarStyle()
защищенный Метод
Publish the calendar style Css asset file.
registerCalendarClientScriptPre()
защищенный Метод
Registers the javascript code to initialize the date picker.
This method overrides parent implementation by adding
additional date picker button if Mode is Button or ImageButton.
renderCalendarDayOptions()
защищенный Метод
Renders the day drop down list options.
renderCalendarMonthOptions()
защищенный Метод
Renders the month drop down list options.
renderCalendarSelections()
защищенный Метод
Renders the calendar drop down list depending on the DateFormat pattern.
renderCalendarYearOptions()
защищенный Метод
Renders the year drop down list options.
renderClientControlScript()
защищенный Метод
renderDropDownListCalendar()
защищенный Метод
Renders the drop down list date picker.
setAutoPostBack()
публичный Метод
AutoPostBack is not supported.
setButtonText()
публичный Метод
setCalendarStyle()
публичный Метод
setCulture()
публичный Метод
Sets the culture/language for the date picker.
setData()
публичный Метод
This method is required by {@link \Prado\IDataRenderer}.
It is the same as {@link setTimeStamp()}.
setDate()
публичный Метод
setFirstDayOfWeek()
публичный Метод
Set the first day of week, with 0 as Sunday, 1 as Monday, etc.
setFromYear()
публичный Метод
setMode()
публичный Метод
setPositionMode()
публичный Метод
setShowCalendar()
публичный Метод
Sets whether to pop up the calendar window when the control receives focus
setTimeStamp()
публичный Метод
Sets the date for the date picker using timestamp.
setUpToYear()
публичный Метод