From 2cfb8c173b33a98a82c42ff635574981b560e239 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Wed, 27 Sep 2017 10:46:20 +0200 Subject: [PATCH] Fixed from front-end date representation bug --- var/www/modules/sentiment/Flask_sentiment.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/var/www/modules/sentiment/Flask_sentiment.py b/var/www/modules/sentiment/Flask_sentiment.py index c5c9537f..e612a3e8 100644 --- a/var/www/modules/sentiment/Flask_sentiment.py +++ b/var/www/modules/sentiment/Flask_sentiment.py @@ -109,11 +109,11 @@ def sentiment_analysis_plot_tool_getdata(): query = query.split(',') Qdate = request.args.get('Qdate') - date1 = (Qdate.split('-')[0]).split('.') - date1 = datetime.date(int(date1[2]), int(date1[1]), int(date1[0])) + date1 = (Qdate.split('-')[0]).split('/') + date1 = datetime.date(int(date1[2]), int(date1[0]), int(date1[1])) - date2 = (Qdate.split('-')[1]).split('.') - date2 = datetime.date(int(date2[2]), int(date2[1]), int(date2[0])) + date2 = (Qdate.split('-')[1]).split('/') + date2 = datetime.date(int(date2[2]), int(date2[0]), int(date2[1])) timestamp1 = calendar.timegm(date1.timetuple()) timestamp2 = calendar.timegm(date2.timetuple())