Skip to content

Commit

Permalink
fix: add datepicker to filters with datetime & date input fields
Browse files Browse the repository at this point in the history
  • Loading branch information
marcwieland95 committed Jul 18, 2024
1 parent de5b5a1 commit 4f2f45d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/Filter/Type/DateFilterType.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ public function getValueField(?string $value = null, ?string $operator = null):
$value = $date->format(static::getDateFormat());

return sprintf(
'<input type="date" name="{name}" value="%s">',
$operator !== static::CRITERIA_IS_EMPTY ? $value : ''
'<input type="date" name="{name}" value="%s" data-controller="araise--core-bundle--datetime" data-araise--core-bundle--datetime-lang-value="%s">',
$operator !== static::CRITERIA_IS_EMPTY ? $value : '',
'de'
);
}

Expand Down
5 changes: 3 additions & 2 deletions src/Filter/Type/DatetimeFilterType.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ public function getValueField(?string $value = null, ?string $operator = null):
$value = $date->format(static::getDateFormat());

return sprintf(
'<input type="datetime-local" name="{name}" value="%s">',
$operator !== static::CRITERIA_IS_EMPTY ? $value : ''
'<input type="datetime-local" name="{name}" value="%s" data-controller="araise--core-bundle--datetime" data-araise--core-bundle--datetime-lang-value="%s">',
$operator !== static::CRITERIA_IS_EMPTY ? $value : '',
'de'
);
}

Expand Down

0 comments on commit 4f2f45d

Please sign in to comment.