Here's the way I'm inserting the date coming from an "update" function:
ajax: {
path: '/companies/update-activit
y',
params: {
company: companyId,
activityId: activityId
},
onComplete: function (resp, self) {
if (resp.error) {
self.addMsg(resp.msg);
return false;
}
if(dashboard=="yes") { //slightly different "success" message for the dashboard
CAMS.alert('You have successfully updated your activity! Please refresh your page to see the changes.');
return false;
}
else {
$('#notes-'+activityId).te
xt(resp.no
tes);
$('#date-'+activityId).text(resp.date);
$('#type-'+activityId).tex
t(resp.typ
e);
CAMS.alert('You have successfully updated your activity!');
return false
}
}
}
You see what's happening? I run my AJAX call and the data coming back from the update method gets inserted into the form giving the user the ability to feel like the pop up window reflects the changes they just made.
My challenge is that the format of the date needs to match what's going on in the app.
So, instead of the 4/18/2020 4:02 PM that you see in the date field...
![date screenshot]()
...it needs to read Apr 18th, 2020 4:02 PM
I tried this: b]$('#date-'+activityId).t
ext(resp.d
ate("M jS, Y \\a\\t g:i a"));[/b]
...but that didn't work.
What am I missing?