Merge pull request #162 from mokaddem/sentimentBugfix

Fix: bug between front-end and back-end date representation
This commit is contained in:
mokaddem 2017-12-11 16:35:38 +01:00 committed by GitHub
commit 9cab76cf88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -109,11 +109,11 @@ def sentiment_analysis_plot_tool_getdata():
query = query.split(',') query = query.split(',')
Qdate = request.args.get('Qdate') Qdate = request.args.get('Qdate')
date1 = (Qdate.split('-')[0]).split('.') date1 = (Qdate.split('-')[0]).split('/')
date1 = datetime.date(int(date1[2]), int(date1[1]), int(date1[0])) date1 = datetime.date(int(date1[2]), int(date1[0]), int(date1[1]))
date2 = (Qdate.split('-')[1]).split('.') date2 = (Qdate.split('-')[1]).split('/')
date2 = datetime.date(int(date2[2]), int(date2[1]), int(date2[0])) date2 = datetime.date(int(date2[2]), int(date2[0]), int(date2[1]))
timestamp1 = calendar.timegm(date1.timetuple()) timestamp1 = calendar.timegm(date1.timetuple())
timestamp2 = calendar.timegm(date2.timetuple()) timestamp2 = calendar.timegm(date2.timetuple())