Updating campaign datepicker format to match other date formats. Fixes #1288

pull/1125/head^2
Jordan Wright 2018-12-30 14:26:35 -06:00
parent b4ff771b3a
commit 4ec9f07859
2 changed files with 7 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,7 @@ function launch() {
// Validate our fields // Validate our fields
var send_by_date = $("#send_by_date").val() var send_by_date = $("#send_by_date").val()
if (send_by_date != "") { if (send_by_date != "") {
send_by_date = moment(send_by_date, "MM/DD/YYYY hh:mm a").utc().format() send_by_date = moment(send_by_date, "MMMM Do YYYY, h:mm a").utc().format()
} }
campaign = { campaign = {
name: $("#name").val(), name: $("#name").val(),
@ -49,7 +49,7 @@ function launch() {
smtp: { smtp: {
name: $("#profile").select2("data")[0].text name: $("#profile").select2("data")[0].text
}, },
launch_date: moment($("#launch_date").val(), "MM/DD/YYYY hh:mm a").utc().format(), launch_date: moment($("#launch_date").val(), "MMMM Do YYYY, h:mm a").utc().format(),
send_by_date: send_by_date || null, send_by_date: send_by_date || null,
groups: groups, groups: groups,
} }
@ -287,14 +287,16 @@ $(document).ready(function () {
"vertical": "bottom" "vertical": "bottom"
}, },
"showTodayButton": true, "showTodayButton": true,
"defaultDate": moment() "defaultDate": moment(),
"format": "MMMM Do YYYY, h:mm a"
}) })
$("#send_by_date").datetimepicker({ $("#send_by_date").datetimepicker({
"widgetPositioning": { "widgetPositioning": {
"vertical": "bottom" "vertical": "bottom"
}, },
"showTodayButton": true, "showTodayButton": true,
"useCurrent": false "useCurrent": false,
"format": "MMMM Do YYYY, h:mm a"
}) })
// Setup multiple modals // Setup multiple modals
// Code based on http://miles-by-motorcycle.com/static/bootstrap-modal/index.html // Code based on http://miles-by-motorcycle.com/static/bootstrap-modal/index.html