Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 685d506

Browse files
Merge forwardport of magento/magento2#11057 to 2.3-develop branch
Applied pull request patch https://github.com/magento/magento2/pull/11057.patch (created by @joachimVT) based on commit(s): 1. c3ea1f5 2. 0c0393d 3. 9fa5ddd Fixed GitHub Issues in 2.3-develop branch: - magento/magento2#6350: Frontend: Datepicker/calendar control does not use the store locale (reported by @heldchen)
2 parents 215180d + eafc6f0 commit 685d506

File tree

2 files changed

+17
-1
lines changed
  • app/code/Magento/Customer/Block/Widget
  • lib/internal/Magento/Framework/View/Element/Html

2 files changed

+17
-1
lines changed

app/code/Magento/Customer/Block/Widget/Dob.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ public function getFieldHtml()
186186
'max_date' => '-1d',
187187
'change_month' => 'true',
188188
'change_year' => 'true',
189-
'show_on' => 'both'
189+
'show_on' => 'both',
190+
'first_day' => $this->getFirstDay()
190191
]);
191192
return $this->dateElement->getHtml();
192193
}
@@ -304,4 +305,17 @@ public function getMaxDateRange()
304305
}
305306
return null;
306307
}
308+
309+
/**
310+
* Return first day of the week
311+
*
312+
* @return int
313+
*/
314+
public function getFirstDay()
315+
{
316+
return (int)$this->_scopeConfig->getValue(
317+
'general/locale/firstday',
318+
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
319+
);
320+
}
307321
}

lib/internal/Magento/Framework/View/Element/Html/Date.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ protected function _toHtml()
2626
$changeYear = $this->getChangeYear();
2727
$maxDate = $this->getMaxDate();
2828
$showOn = $this->getShowOn();
29+
$firstDay = $this->getFirstDay();
2930

3031
$html .= '<script type="text/javascript">
3132
require(["jquery", "mage/calendar"], function($){
@@ -59,6 +60,7 @@ protected function _toHtml()
5960
($changeMonth === null ? '' : ', changeMonth: ' . $changeMonth) .
6061
($changeYear === null ? '' : ', changeYear: ' . $changeYear) .
6162
($showOn ? ', showOn: "' . $showOn . '"' : '') .
63+
($firstDay ? ', firstDay: ' . $firstDay : '') .
6264
'})
6365
});
6466
</script>';

0 commit comments

Comments
 (0)