File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
app/code/Magento/Customer/Block/Widget Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ public function getLabel()
175
175
public function getFieldHtml ()
176
176
{
177
177
$ this ->dateElement ->setData ([
178
- 'extra_params ' => $ this ->isRequired () ? ' data-validate="{required:true}" ' : '' ,
178
+ 'extra_params ' => $ this ->getHtmlExtraParams () ,
179
179
'name ' => $ this ->getHtmlId (),
180
180
'id ' => $ this ->getHtmlId (),
181
181
'class ' => $ this ->getHtmlClass (),
@@ -201,6 +201,26 @@ public function getHtmlId()
201
201
return 'dob ' ;
202
202
}
203
203
204
+ /**
205
+ * Return id
206
+ *
207
+ * @return string
208
+ */
209
+ public function getHtmlExtraParams ()
210
+ {
211
+ $ extraParams = array (
212
+ "'validate-date-au':true "
213
+ );
214
+
215
+ if ($ this ->isRequired ()) {
216
+ array_push ($ extraParams , 'required:true ' );
217
+ }
218
+
219
+ $ extraParams = implode (', ' , $ extraParams );
220
+
221
+ return 'data-validate="{ ' . $ extraParams . '}" ' ;
222
+ }
223
+
204
224
/**
205
225
* Returns format which will be applied for DOB in javascript
206
226
*
You can’t perform that action at this time.
0 commit comments