Respect WP's first day of week setting in schedule calendar
[MAILPOET-1995]
This commit is contained in:
@@ -94,6 +94,7 @@ class DateText extends React.Component {
|
|||||||
|
|
||||||
$element.datepicker(_.extend({
|
$element.datepicker(_.extend({
|
||||||
dateFormat: this.props.displayFormat,
|
dateFormat: this.props.displayFormat,
|
||||||
|
firstDay: window.mailpoet_start_of_week,
|
||||||
isRTL: false,
|
isRTL: false,
|
||||||
onSelect: function onSelect(value) {
|
onSelect: function onSelect(value) {
|
||||||
that.onChange({
|
that.onChange({
|
||||||
|
@@ -123,6 +123,11 @@ class Functions extends AbstractExtension {
|
|||||||
array($this, 'isWoocommerceActive'),
|
array($this, 'isWoocommerceActive'),
|
||||||
array('is_safe' => array('all'))
|
array('is_safe' => array('all'))
|
||||||
),
|
),
|
||||||
|
new TwigFunction(
|
||||||
|
'wp_start_of_week',
|
||||||
|
array($this, 'getWPStartOfWeek'),
|
||||||
|
array('is_safe' => array('all'))
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,6 +171,10 @@ class Functions extends AbstractExtension {
|
|||||||
return WPFunctions::get()->getOption('date_format') ?: 'F j, Y';
|
return WPFunctions::get()->getOption('date_format') ?: 'F j, Y';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getWPStartOfWeek() {
|
||||||
|
return WPFunctions::get()->getOption('start_of_week') ?: 0;
|
||||||
|
}
|
||||||
|
|
||||||
function getMailPoetVersion() {
|
function getMailPoetVersion() {
|
||||||
return MAILPOET_VERSION;
|
return MAILPOET_VERSION;
|
||||||
}
|
}
|
||||||
|
@@ -17,6 +17,7 @@
|
|||||||
var mailpoet_server_time_zone = <%= json_encode(current_time_zone) %>;
|
var mailpoet_server_time_zone = <%= json_encode(current_time_zone) %>;
|
||||||
var mailpoet_schedule_time_of_day = <%= json_encode(schedule_time_of_day) %>;
|
var mailpoet_schedule_time_of_day = <%= json_encode(schedule_time_of_day) %>;
|
||||||
var mailpoet_date_display_format = "<%= wp_date_format() %>";
|
var mailpoet_date_display_format = "<%= wp_date_format() %>";
|
||||||
|
var mailpoet_start_of_week = "<%= wp_start_of_week() %>";
|
||||||
var mailpoet_site_url = "<%= site_url %>";
|
var mailpoet_site_url = "<%= site_url %>";
|
||||||
var mailpoet_date_storage_format = "Y-m-d";
|
var mailpoet_date_storage_format = "Y-m-d";
|
||||||
var mailpoet_tracking_enabled = <%= json_encode(tracking_enabled) %>;
|
var mailpoet_tracking_enabled = <%= json_encode(tracking_enabled) %>;
|
||||||
|
Reference in New Issue
Block a user