Skip to content

Commit

Permalink
⏫ Forwardport of #11057 to 2.3-develop branch
Browse files Browse the repository at this point in the history
  • Loading branch information
p-bystritsky committed Jan 24, 2018
1 parent 8e77e2f commit eafc6f0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/code/Magento/Customer/Block/Widget/Dob.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ public function getFieldHtml()
'max_date' => '-1d',
'change_month' => 'true',
'change_year' => 'true',
'show_on' => 'both'
'show_on' => 'both',
'first_day' => $this->getFirstDay()
]);
return $this->dateElement->getHtml();
}
Expand Down Expand Up @@ -307,4 +308,17 @@ public function getMaxDateRange()
}
return null;
}

/**
* Return first day of the week
*
* @return int
*/
public function getFirstDay()
{
return (int)$this->_scopeConfig->getValue(
'general/locale/firstday',
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
}
}
2 changes: 2 additions & 0 deletions lib/internal/Magento/Framework/View/Element/Html/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ protected function _toHtml()
$changeYear = $this->getChangeYear();
$maxDate = $this->getMaxDate();
$showOn = $this->getShowOn();
$firstDay = $this->getFirstDay();

$html .= '<script type="text/javascript">
require(["jquery", "mage/calendar"], function($){
Expand Down Expand Up @@ -59,6 +60,7 @@ protected function _toHtml()
($changeMonth === null ? '' : ', changeMonth: ' . $changeMonth) .
($changeYear === null ? '' : ', changeYear: ' . $changeYear) .
($showOn ? ', showOn: "' . $showOn . '"' : '') .
($firstDay ? ', firstDay: ' . $firstDay : '') .
'})
});
</script>';
Expand Down

0 comments on commit eafc6f0

Please sign in to comment.