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