Display placeholder for date filter (#5767)

* Display placeholder for date filter

* CHANGELOG Update (#5767)

Co-authored-by: Lucas Bartholemy <luke-@users.noreply.github.com>
This commit is contained in:
Yuriy Bakhtin 2022-06-22 17:43:58 +03:00 committed by GitHub
parent b5aaebcb2f
commit 7b5c9b7b22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -13,5 +13,7 @@
- Enh #5598: Added `cy` Welsh language
- Fix #5338: Content topic/visibility changes are re-indexed in search index
- Enh #5535: Invisible users
- Enh #5747: Switch Mailer Library to `Symfony Mailer`
- Enh #5767: Display placeholder for date filter
- Enh #5747: Switch Mailer Library to `Symfony Mailer`
- Fix #5765: Fix rendering content form on external modules

View File

@ -8,9 +8,10 @@
namespace humhub\modules\ui\filter\widgets;
use DateTime;
use humhub\modules\ui\form\widgets\DatePicker;
use Yii;
use yii\helpers\ArrayHelper;
use yii\helpers\FormatConverter;
class DatePickerFilterInput extends FilterInput
{
@ -36,6 +37,11 @@ class DatePickerFilterInput extends FilterInput
{
$filter = Yii::$app->request->get($this->category);
$this->value = $filter;
if (!isset($this->options['placeholder'])) {
$this->options['placeholder'] = (new DateTime())
->format(FormatConverter::convertDateIcuToPhp(Yii::$app->formatter->dateInputFormat));
}
}
/**