Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Add Year to Job Run Timestamp in pipeline-stage-view-plugin #347

Merged
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<revision>2.35</revision>
<gitHubRepo>jenkinsci/pipeline-stage-view-plugin</gitHubRepo>
<bom>2.361.x</bom>
<jenkins.version>2.361.4</jenkins.version>
<jenkins.version>2.462.1</jenkins.version>
jglick marked this conversation as resolved.
Show resolved Hide resolved
<changelist>-SNAPSHOT</changelist>
<node.version>18.7.0</node.version>
<npm.version>8.15.0</npm.version>
Expand Down
119 changes: 119 additions & 0 deletions pom.xml.versionsBackup
jglick marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ The MIT License
~
~ Copyright (c) 2013-2016, CloudBees, Inc.
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in
~ all copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
~ THE SOFTWARE.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.75</version>
<relativePath />
</parent>

<groupId>org.jenkins-ci.plugins.pipeline-stage-view</groupId>
<artifactId>parent-pom</artifactId>
<version>${revision}${changelist}</version>
<packaging>pom</packaging>
<name>Pipeline Stage View Plugin: Parent POM</name>

<url>https://github.com/jenkinsci/pipeline-stage-view-plugin</url>

<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>

<scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
<connection>scm:git:https://github.com/${gitHubRepo}.git</connection>
<developerConnection>scm:git:https://github.com/${gitHubRepo}.git</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<tag>${scmTag}</tag>
</scm>

<properties>
<revision>2.35</revision>
<gitHubRepo>jenkinsci/pipeline-stage-view-plugin</gitHubRepo>
<bom>2.361.x</bom>
<jenkins.version>2.361.4</jenkins.version>
<changelist>-SNAPSHOT</changelist>
<node.version>18.7.0</node.version>
<npm.version>8.15.0</npm.version>
<frontend-version>1.14.2</frontend-version>
</properties>

<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>

<modules>
<module>rest-api</module>
<module>ui</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<tagNameFormat>pipeline-stage-view-@{project.version}</tagNameFormat>
</configuration>
</plugin>
</plugins>
</build>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-${bom}</artifactId>
<version>2102.v854b_fec19c92</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230618</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.33</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
4 changes: 4 additions & 0 deletions ui/src/main/js/view/templates/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ registerHBSHelper('formatDate', function (date, toFormat) {
if (toFormat == 'time') {
return theDate.toLocaleTimeString(userLocale, {hour: '2-digit',minute: '2-digit', hour12: false });
}
// New case for 'year'
DeepData-Diver marked this conversation as resolved.
Show resolved Hide resolved
if (toFormat == 'year') {
return theDate.toLocaleDateString(userLocale, {year: 'numeric'});
}
return theDate.toLocaleDateString(userLocale, options)
});

Expand Down
1 change: 1 addition & 0 deletions ui/src/main/js/view/templates/pipeline-staged.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<div class="stage-start-box">
<div class="stage-start-time">
<div class="date">{{formatDate this.startTimeMillis 'month'}} {{formatDate this.startTimeMillis 'dom'}}</div>
<div class="year">{{formatDate this.startTimeMillis 'year'}}</div>
<div class="time">{{formatDate this.startTimeMillis 'time'}}</div>
</div>
{{#if this._links.changesets}}<div class="changeset-box" cbwf-controller="run-changesets" objectUrl="{{this._links.changesets.href}}"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ <h2>Stage View</h2>
<div class="stage-start-box">
<div class="stage-start-time">
<div class="date">1414318349569 1414318349569</div>
<div class="year">1414318349569</div>
<div class="time">1414318349569</div>
</div>
<div class="changeset-box no-changes">No Changes</div>
Expand Down Expand Up @@ -125,6 +126,7 @@ <h2>Stage View</h2>
<div class="stage-start-box">
<div class="stage-start-time">
<div class="date">1414318232950 1414318232950</div>
<div class="year">1414318232950</div>
<div class="time">1414318232950</div>
</div>
<div class="changeset-box no-changes">No Changes</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ <h2>Stage View</h2>
<div class="stage-start-box">
<div class="stage-start-time">
<div class="date">1414318232950 1414318232950</div>
<div class="year">1414318232950</div>
<div class="time">1414318232950</div>
</div>
<div class="changeset-box no-changes">No Changes</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ <h2>Stage View</h2>
<div class="stage-start-box">
<div class="stage-start-time">
<div class="date">1411556423000 1411556423000</div>
<div class="year">1411556423000</div>
<div class="time">1411556423000</div>
</div>
<div class="changeset-box no-changes">No Changes</div>
Expand Down Expand Up @@ -108,6 +109,7 @@ <h2>Stage View</h2>
<div class="stage-start-box">
<div class="stage-start-time">
<div class="date">1411556089000 1411556089000</div>
<div class="year">1411556089000</div>
<div class="time">1411556089000</div>
</div>
<div class="changeset-box no-changes">No Changes</div>
Expand Down Expand Up @@ -162,6 +164,7 @@ <h2>Stage View</h2>
<div class="stage-start-box">
<div class="stage-start-time">
<div class="date">1411552553000 1411552553000</div>
<div class="year">1411552553000</div>
<div class="time">1411552553000</div>
</div>
<div class="changeset-box no-changes">No Changes</div>
Expand Down