mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-29 04:25:23 +00:00
Show plugin release date in plugin manager (#4535)
* Show plugin release date in plugin manager * Add at-since Co-Authored-By: Oleg Nenashev <o.v.nenashev@gmail.com> * Make sorting work property - Sort independently of sortable.js date parsing magic - Hide categories when sorting by release date * Show friendlier labels for the age of plugin releases Co-authored-by: Oleg Nenashev <o.v.nenashev@gmail.com>
This commit is contained in:
1 parent
3ebb9e3592
commit
9537ee5154
5 files changed
+61
-2
No files matched your search
@@ -27,6 +27,8 @@ package hudson;
|
||||
|
||||
import hudson.model.Slave;
|
||||
import hudson.security.*;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.function.Predicate;
|
||||
import jenkins.util.SystemProperties;
|
||||
import hudson.cli.CLICommand;
|
||||
@@ -219,10 +221,36 @@ public class Functions {
|
||||
return Util.XS_DATETIME_FORMATTER.format(cal.getTime());
|
||||
}
|
||||
|
||||
@Restricted(NoExternalUse.class)
|
||||
public static String iso8601DateTime(Date date) {
|
||||
return Util.XS_DATETIME_FORMATTER.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a localized string for the specified date, not including time.
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
@Restricted(NoExternalUse.class)
|
||||
public static String localDate(Date date) {
|
||||
return SimpleDateFormat.getDateInstance(SimpleDateFormat.SHORT).format(date);
|
||||
}
|
||||
|
||||
public static String rfc822Date(Calendar cal) {
|
||||
return Util.RFC822_DATETIME_FORMATTER.format(cal.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a human-readable string describing the time difference between now and the specified date.
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
@Restricted(NoExternalUse.class)
|
||||
public static String getTimeSpanString(Date date) {
|
||||
return Util.getTimeSpanString(Math.abs(date.getTime() - new Date().getTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* During Jenkins start-up, before {@link InitMilestone#PLUGINS_STARTED} the extensions lists will be empty
|
||||
* and they are not guaranteed to be fully populated until after {@link InitMilestone#EXTENSIONS_AUGMENTED},
|
||||
|
||||
Reference in new issue
Block a user