Change notification newsletter time to be displayed in WP format
This commit is contained in:
@@ -43,8 +43,9 @@ define('date',
|
|||||||
options = options || {};
|
options = options || {};
|
||||||
this.init(options);
|
this.init(options);
|
||||||
|
|
||||||
return Moment(date, this.convertFormat(options.parseFormat))
|
var date = Moment(date, this.convertFormat(options.parseFormat));
|
||||||
.format(this.convertFormat(this.options.format));
|
if (options.offset === 0) date = date.utc();
|
||||||
|
return date.format(this.convertFormat(this.options.format));
|
||||||
},
|
},
|
||||||
toDate: function(date, options) {
|
toDate: function(date, options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
import _ from 'underscore'
|
import _ from 'underscore'
|
||||||
import MailPoet from 'mailpoet'
|
import MailPoet from 'mailpoet'
|
||||||
|
|
||||||
|
const timeFormat = window.mailpoet_time_format || 'H:i';
|
||||||
|
|
||||||
// welcome emails
|
// welcome emails
|
||||||
const _timeDelayValues = {
|
const _timeDelayValues = {
|
||||||
'immediate': MailPoet.I18n.t('delayImmediately'),
|
'immediate': MailPoet.I18n.t('delayImmediately'),
|
||||||
@@ -28,7 +30,7 @@ const _timeOfDayValues = _.object(_.map(
|
|||||||
}), function(seconds) {
|
}), function(seconds) {
|
||||||
let date = new Date(null);
|
let date = new Date(null);
|
||||||
date.setSeconds(seconds);
|
date.setSeconds(seconds);
|
||||||
const timeLabel = date.toISOString().substr(11, 5);
|
const timeLabel = MailPoet.Date.format(date, { format: timeFormat, offset: 0 });
|
||||||
return [seconds, timeLabel];
|
return [seconds, timeLabel];
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -77,4 +79,4 @@ export { _intervalValues as intervalValues };
|
|||||||
export { _timeOfDayValues as timeOfDayValues };
|
export { _timeOfDayValues as timeOfDayValues };
|
||||||
export { _weekDayValues as weekDayValues };
|
export { _weekDayValues as weekDayValues };
|
||||||
export { _monthDayValues as monthDayValues };
|
export { _monthDayValues as monthDayValues };
|
||||||
export { _nthWeekDayValues as nthWeekDayValues };
|
export { _nthWeekDayValues as nthWeekDayValues };
|
||||||
|
@@ -141,4 +141,4 @@ const NotificationScheduling = React.createClass({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = NotificationScheduling;
|
module.exports = NotificationScheduling;
|
||||||
|
@@ -38,6 +38,11 @@ jQuery('.toplevel_page_mailpoet.menu-top-last')
|
|||||||
|
|
||||||
<% block after_css %><% endblock %>
|
<% block after_css %><% endblock %>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var mailpoet_date_format = "<%= wp_datetime_format() %>";
|
||||||
|
var mailpoet_time_format = "<%= wp_time_format() %>";
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- javascripts -->
|
<!-- javascripts -->
|
||||||
<%= javascript(
|
<%= javascript(
|
||||||
'vendor.js',
|
'vendor.js',
|
||||||
@@ -51,8 +56,6 @@ jQuery('.toplevel_page_mailpoet.menu-top-last')
|
|||||||
)%>
|
)%>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var mailpoet_date_format = "<%= wp_datetime_format() %>";
|
|
||||||
|
|
||||||
if(window['HS'] !== undefined) {
|
if(window['HS'] !== undefined) {
|
||||||
HS.beacon.config({
|
HS.beacon.config({
|
||||||
icon: 'message',
|
icon: 'message',
|
||||||
|
Reference in New Issue
Block a user