From eafc6f0a473547542c3ef80352dcd2be7128da87 Mon Sep 17 00:00:00 2001
From: Pavel Bystritsky
Date: Wed, 24 Jan 2018 17:38:03 +0200
Subject: [PATCH] :arrow_double_up: Forwardport of magento/magento2#11057 to
2.3-develop branch
---
app/code/Magento/Customer/Block/Widget/Dob.php | 16 +++++++++++++++-
.../Magento/Framework/View/Element/Html/Date.php | 2 ++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/Customer/Block/Widget/Dob.php b/app/code/Magento/Customer/Block/Widget/Dob.php
index f29a9fc76f1d2..e7d4f286464f5 100644
--- a/app/code/Magento/Customer/Block/Widget/Dob.php
+++ b/app/code/Magento/Customer/Block/Widget/Dob.php
@@ -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();
}
@@ -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
+ );
+ }
}
diff --git a/lib/internal/Magento/Framework/View/Element/Html/Date.php b/lib/internal/Magento/Framework/View/Element/Html/Date.php
index 648d9ad6917e4..558e39427cb44 100644
--- a/lib/internal/Magento/Framework/View/Element/Html/Date.php
+++ b/lib/internal/Magento/Framework/View/Element/Html/Date.php
@@ -26,6 +26,7 @@ protected function _toHtml()
$changeYear = $this->getChangeYear();
$maxDate = $this->getMaxDate();
$showOn = $this->getShowOn();
+ $firstDay = $this->getFirstDay();
$html .= '';