Skip to content

Commit

Permalink
JENKINS-75163 fix date in historywidget
Browse files Browse the repository at this point in the history
Fixes the date when the user configured timezone differs from the
controller timezone.
  • Loading branch information
mawinter69 committed Jan 18, 2025
1 parent ab6fd43 commit 4d220b7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:i="jelly:fmt">
<j:set target="${it}" property="nextBuildNumberToFetch" value="${it.nextBuildNumber}" />
<j:invokeStatic className="java.time.LocalDate" method="now" var="now" />
<j:if test="${h.isUserTimeZoneOverride()}">
<i:setTimeZone value="${h.getUserTimeZone()}" />
</j:if>
<j:new var="dateNow" className="java.util.Date"/>
<i:formatDate value="${dateNow}" var="now" type="date" pattern="YYYY-MM-dd"/>

<j:forEach var="pageEntry" items="${it.runs}">
<i:formatDate value="${pageEntry.entry.timestamp.time}" var="date" type="date" dateStyle="long" />
Expand Down

0 comments on commit 4d220b7

Please sign in to comment.