Skip to content

Commit

Permalink
Merge #11057 commit 'refs/pull/11057/head' of https://github.com/mage…
Browse files Browse the repository at this point in the history
…nto/magento2 into MAGETWO-80114-PR-11057

# Conflicts:
#	app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui.js
#	dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Backend/_files/controller_acl_test_whitelist_ce.txt
  • Loading branch information
vrann committed Sep 27, 2017
2 parents e442de5 + 9fa5ddd commit de10ada
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 de10ada

Please sign in to comment.