66
77namespace Magento \Ui \Component \Filters \Type ;
88
9+ use Magento \Framework \Api \FilterBuilder ;
10+ use Magento \Framework \View \Element \UiComponent \ContextInterface ;
11+ use Magento \Framework \View \Element \UiComponentFactory ;
12+ use Magento \Ui \Component \Filters \FilterModifier ;
913use Magento \Ui \Component \Form \Element \DataType \Date as DataTypeDate ;
1014
1115/**
@@ -31,6 +35,33 @@ class Date extends AbstractFilter
3135 */
3236 protected static $ dateFormat = 'Y-m-d H:i:s ' ;
3337
38+ /**
39+ * @var bool
40+ */
41+ private bool $ userDefined ;
42+
43+ /**
44+ * @param ContextInterface $context
45+ * @param UiComponentFactory $uiComponentFactory
46+ * @param FilterBuilder $filterBuilder
47+ * @param FilterModifier $filterModifier
48+ * @param array $components
49+ * @param array $data
50+ * @param bool $userDefined
51+ */
52+ public function __construct (
53+ ContextInterface $ context ,
54+ UiComponentFactory $ uiComponentFactory ,
55+ FilterBuilder $ filterBuilder ,
56+ FilterModifier $ filterModifier ,
57+ array $ components = [],
58+ array $ data = [],
59+ bool $ userDefined = false
60+ ) {
61+ $ this ->userDefined = $ userDefined ;
62+ parent ::__construct ($ context , $ uiComponentFactory , $ filterBuilder , $ filterModifier , $ components , $ data );
63+ }
64+
3465 /**
3566 * Prepare component configuration
3667 *
@@ -138,7 +169,8 @@ private function convertDatetime(string $value, int $hour = 0, int $minute = 0,
138169 $ hour ,
139170 $ minute ,
140171 $ second ,
141- !$ this ->getData ('config/skipTimeZoneConversion ' )
172+ !$ this ->getData ('config/skipTimeZoneConversion ' ),
173+ !$ this ->userDefined
142174 );
143175
144176 return $ value ;
0 commit comments