Skip to content

Commit

Permalink
Merge 7953188 into c68a39b
Browse files Browse the repository at this point in the history
  • Loading branch information
oriolpiera committed Mar 21, 2024
2 parents c68a39b + 7953188 commit 765c80e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion som_generationkwh/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from dateutil.relativedelta import relativedelta
from tools.translate import _
from mongodb_backend.mongodb2 import mdbpool
import pytz

from generationkwh.sharescurve import MemberSharesCurve
from generationkwh.rightspershare import RightsPerShare
Expand Down Expand Up @@ -159,10 +160,11 @@ def _hourly_rights_generationkwh(self, cursor, uid, partner_id, start_date=None,

@staticmethod
def _prepare_datetime_value_www_response(dict_with_data):
cet = pytz.timezone('CET')
return [
{
'date': int(
mktime(datetime.strptime(k, '%Y-%m-%d %H:%M:%S').timetuple())
datetime.strptime(k, '%Y-%m-%d %H:%M:%S').replace(tzinfo=cet).timestamp()
)*1000, # javascript works with 3 more 0 than python
'value': dict_with_data[k]
} for k in sorted(dict_with_data)
Expand Down

0 comments on commit 765c80e

Please sign in to comment.