Skip to content

Commit

Permalink
993 - Added TDatePicker::DropDownCssClass to apply a class to all the…
Browse files Browse the repository at this point in the history
… dropdowns
  • Loading branch information
ctrlaltca committed Nov 28, 2023
1 parent b3f1b01 commit eb8ea39
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Version 4.3.x - TBD

ENH: Issue #993 - Added TDatePicker::DropDownCssClass to apply a class to all the dropdowns

## Version 4.3.0 - October 26, 2023

ENH: Issues #824, #838, #851, #891, #910, #917 - General Behaviors Update: Cloning and Serializing supports behaviors. IBaseBehavior has init($config) method. TClassBehavior tracks their owners. Behaviors attach their registered event handlers at the behavior priority. Registered Behavior event can optionally attached and detached automatically when the behavior is enabled or disabled (default). Behavior events() support Closures. IBehavior are attachable class-wide by cloning. Behaviors for behaviors has better support. Behaviors are case insensitive. Supports Anonymous (unnamed/numeric) behaviors. Wakeup updates the component behaviors with new named class behaviors. (belisoful)
Expand Down
22 changes: 19 additions & 3 deletions framework/Web/UI/WebControls/TDatePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,22 @@ public function getCalendarStyle()
return $this->getViewState('CalendarStyle', 'default');
}

/**
* @param string $value Additional Css class name applied to dropdowns in DropDownList mode.
*/
public function setDropDownCssClass($value)
{
$this->setViewState('DropDownCssClass', $value);
}

/**
* @return string Additional Css class name applied to dropdowns in DropDownList mode.
*/
public function getDropDownCssClass()
{
return $this->getViewState('DropDownCssClass');
}

/**
* Set the first day of week, with 0 as Sunday, 1 as Monday, etc.
* @param int $value 0 for Sunday, 1 for Monday, 2 for Tuesday, etc.
Expand Down Expand Up @@ -702,7 +718,7 @@ protected function renderCalendarDayOptions($writer, $selected = null)
$days = $this->getDropDownDayOptions();
$writer->addAttribute('id', $this->getClientID() . TControl::CLIENT_ID_SEPARATOR . 'day');
$writer->addAttribute('name', $this->getUniqueID() . TControl::ID_SEPARATOR . 'day');
$writer->addAttribute('class', 'datepicker_day_options');
$writer->addAttribute('class', 'datepicker_day_options ' . $this->getDropDownCssClass());
if ($this->getReadOnly() || !$this->getEnabled(true)) {
$writer->addAttribute('disabled', 'disabled');
}
Expand Down Expand Up @@ -735,7 +751,7 @@ protected function renderCalendarMonthOptions($writer, $selected = null)
$info = $this->getLocalizedCalendarInfo();
$writer->addAttribute('id', $this->getClientID() . TControl::CLIENT_ID_SEPARATOR . 'month');
$writer->addAttribute('name', $this->getUniqueID() . TControl::ID_SEPARATOR . 'month');
$writer->addAttribute('class', 'datepicker_month_options');
$writer->addAttribute('class', 'datepicker_month_options ' . $this->getDropDownCssClass());
if ($this->getReadOnly() || !$this->getEnabled(true)) {
$writer->addAttribute('disabled', 'disabled');
}
Expand Down Expand Up @@ -790,7 +806,7 @@ protected function renderCalendarYearOptions($writer, $selected = null)
}
$writer->addAttribute('id', $this->getClientID() . TControl::CLIENT_ID_SEPARATOR . 'year');
$writer->addAttribute('name', $this->getUniqueID() . TControl::ID_SEPARATOR . 'year');
$writer->addAttribute('class', 'datepicker_year_options');
$writer->addAttribute('class', 'datepicker_year_options ' . $this->getDropDownCssClass());
if ($this->getReadOnly() || !$this->getEnabled(true)) {
$writer->addAttribute('disabled', 'disabled');
}
Expand Down

0 comments on commit eb8ea39

Please sign in to comment.