Change dates to local time

Transactions
= 2017-09-17 16:27:00 -06:00
parent c63902423a
commit 0f18fb0222
3 changed files with 8 additions and 3 deletions

View File

@ -29,8 +29,8 @@ export class EventService {
let fd = new FormData();
fd.append("title",event.title);
fd.append("description",event.description);
fd.append("startDate",new Date(event.startDate).toUTCString());
fd.append("endDate",new Date(event.endDate).toUTCString());
fd.append("startDate",new Date(event.startDate).toString());
fd.append("endDate",new Date(event.endDate).toString());
return this.http.post(EVENTS_ADD_URL,fd,{withCredentials:true})
.map(d=>{ return d.json(); })

View File

@ -47,10 +47,11 @@ export class SermonService {
let fd = new FormData();
fd.append("title",sermon.title);
fd.append("description",sermon.description);
fd.append("date",new Date(sermon.sermonDate).toUTCString());
fd.append("date",new Date(sermon.sermonDate).toString());
fd.append("author",sermon.author);
fd.append("file",sermonFile);
return this.http.post(SERMON_ADD_URL,fd,{withCredentials:true})
.map(d=>{ return d.json(); })
.catch(this.dataError);

View File

@ -7,6 +7,10 @@ var tmpStorage = process.env['HOME'] + '/webapps/ofbstatic/media/sermons/tmp/';
var finalStorage = process.env['HOME'] + '/webapps/ofbstatic/media/sermons/';
var storage = multer.diskStorage({
destination: function (req, file, cb) {
if (req.hostname.startsWith('localhost')){
tmpStorage = '/home/me/Music/Sermons/tmp/';
finalStorage = '/home/me/Music/Sermons/';
}
cb(null, tmpStorage);
},
filename: function (req, file, cb) {