Skip to content

Commit

Permalink
Merge pull request #309 from abs0/master
Browse files Browse the repository at this point in the history
Adapt for TAO API change - dates now ISO8601 rather than epoch msecs
  • Loading branch information
cpfair authored Mar 23, 2017
2 parents 1487d77 + f857816 commit d3c0b43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tapiriik/services/TrainAsONE/trainasone.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from datetime import datetime, timedelta
from urllib.parse import urlencode
import calendar
import dateutil.parser
import requests
import os
import logging
Expand Down Expand Up @@ -104,7 +105,7 @@ def DownloadActivityList(self, serviceRecord, exhaustive=False):
def _populateActivity(self, rawRecord):
''' Populate the 1st level of the activity object with all details required for UID from API data '''
activity = UploadedActivity()
activity.StartTime = datetime.fromtimestamp(rawRecord["start"] / 1000)
activity.StartTime = dateutil.parser.parse(rawRecord["start"])
activity.EndTime = activity.StartTime + timedelta(seconds=rawRecord["duration"])
activity.Stats.Distance = ActivityStatistic(ActivityStatisticUnit.Meters, value=rawRecord["distance"])
activity.GPS = rawRecord["hasGps"]
Expand Down

0 comments on commit d3c0b43

Please sign in to comment.