Skip to content

Commit

Permalink
Merge pull request #12 from xebialabs-community/finishDate
Browse files Browse the repository at this point in the history
Using dateutil to parse tc timestamps
  • Loading branch information
jdewinne authored Apr 5, 2019
2 parents 32640e7 + be0d280 commit a3bd6cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/teamcity/BuildConfigurationsStatusTile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#

import logging
import time

from dateutil.parser import parse
from teamcity import TeamCityClient

logger = logging.getLogger("TeamCity")
Expand Down Expand Up @@ -62,7 +62,7 @@
build_test_occurrences["failureCount"] = failureCount
project_status["statuses"].append({"name": build_configuration['name'], "status": build_configuration['builds']['build'][0]['status'],
"statusText": build_configuration['builds']['build'][0]['statusText'],
"finishDate": time.strftime("%a, %d %b %Y %H:%M:%S", time.strptime(build_configuration['builds']['build'][0]['finishDate'], "%Y%m%dT%H%M%S+0000")),
"finishDate": parse(build_configuration['builds']['build'][0]['finishDate']).strftime("%a, %d %b %Y %H:%M:%S"),
"problemOccurrences": build_problem_occurrences, "testOccurrences": build_test_occurrences,
"buildLog": processed_build_log,
"statusUrl": "%s/app/rest/builds/buildType:(id:%s)/statusIcon" % (teamcityServer["url"], build_configuration['id']),
Expand Down

0 comments on commit a3bd6cf

Please sign in to comment.