public String getTooltip(final Long duration, final Locale locale, final JiraDurationUtils utils) { if (duration != null) { return utils.getFormattedDuration(duration, locale); } return null; } }
public String getDuration(final Long duration, final Locale locale, final JiraDurationUtils utils) { if (duration != null) { return utils.getFormattedDuration(duration, locale); } return null; }
public String getTooltip(final Long duration, final Locale locale, final JiraDurationUtils utils) { if (duration != null) { return utils.getFormattedDuration(duration, locale); } return null; } }
String getFormattedDuration(Long duration) { return jiraDurationUtils.getFormattedDuration(duration); }
public String getPrettyDuration(final Long v) { return jiraDurationUtils.getFormattedDuration(v); }
public String getPrettyDuration(String duration) { return jiraDurationUtils.getFormattedDuration(new Long(duration)); }
public String getPrettyDuration(String duration) { return jiraDurationUtils.getFormattedDuration(new Long(duration), locale); }
/** * this formatting function is shared by the full view for navigator as well as view issue. * * @param v duration in seconds */ public String getPrettyDuration(final Long v) { return ComponentAccessor.getComponent(JiraDurationUtils.class).getFormattedDuration(v); }
/** * Format up a time spend Long into a JIRA time duration pretty string. * * @param timeSpentInSeconds - the time spend in seconds as a Long * @return a JIRA time duration. */ String formatTimeDuration(long timeSpentInSeconds) { return getJiraDurationUtils().getFormattedDuration(timeSpentInSeconds); }
/** * Formats the duration. If duration is null, returns a dash.. * * @param duration duration * @return formatted duration String or i18ned "unknown" if null. */ public String format(Long duration) { if (duration == null) { return "-"; } duration = Math.abs(duration.longValue()); return jiraDurationUtils.getFormattedDuration(duration, i18nHelper.getLocale()); }
public String prettyPrintChangeHistory(String changeHistory) { if (StringUtils.isNotBlank(changeHistory)) { return durationUtils().getFormattedDuration(new Long(changeHistory)); } else { return super.prettyPrintChangeHistory(changeHistory); } }
/** * this formatting function is shared by the full view for navigator as well as view issue. * * @param v duration in seconds * * @return formatted duration */ public String formatPrettyDuration(Number v) { return jiraDurationUtils.getFormattedDuration(v.longValue(), descriptor.getI18nBean().getLocale()); }
public String prettyPrintChangeHistory(String changeHistory, I18nHelper i18nHelper) { if (StringUtils.isNotBlank(changeHistory)) { return durationUtils().getFormattedDuration(new Long(changeHistory), i18nHelper.getLocale()); } else { return super.prettyPrintChangeHistory(changeHistory); } }
/** * @param issue the current issue * @return null if the remaining estimate is not set; the pretty duration formatted remaining estimate otherwise. */ private String getCurrentEstimate(final Issue issue) { final Long estimate = issue.getEstimate(); return estimate == null ? null : getJiraDurationUtils().getFormattedDuration(estimate); }
public String getEstimate() throws Exception { final Long estimate = getIssueObject().getEstimate(); return estimate == null ? null : jiraDurationUtils.getFormattedDuration(estimate); }
public String getTimeTrackingFormatSample() { return getText(jiraDurationUtils.getI18nKey(), jiraDurationUtils.getFormattedDuration(SAMPLE_DURATION)); }
/** * Converts the given time to nice i18n form or returns i18n [none] if null is passed in. * * @param time time to convert to String * @param i18n internationalizing helper * @return time sa String */ private String convertToNiceTime(Long time, I18nHelper i18n) { if (time == null) { return i18n.getText("viewissue.timetracking.unknown"); } else { return jiraDurationUtils.getFormattedDuration(time, i18n.getLocale()); } }
/** * This is retrieved when the template is being generated so as it is properly formatted for the recipient. * * @return String formatted comment time logged string */ public String getTimeLogged(Worklog worklog, I18nHelper i18n) { if (worklog != null && worklog.getTimeSpent() != null) { return jiraDurationUtils.getFormattedDuration(worklog.getTimeSpent(), i18n.getLocale()); } else { return null; } }
@Override public FieldJsonRepresentation getJsonFromIssue(Issue issue, boolean renderedVersionRequested, @Nullable FieldLayoutItem fieldLayoutItem) { Long duration = getDuration(issue); if (renderedVersionRequested) { JiraDurationUtils jiraDurationUtils = durationUtils(); String durationString = duration == null ? null : jiraDurationUtils.getFormattedDuration(duration); return new FieldJsonRepresentation(new JsonData(duration), new JsonData(durationString)); } else { return new FieldJsonRepresentation(new JsonData(duration)); } } }
@Override public FieldJsonRepresentation getJsonFromIssue(Issue issue, boolean renderedVersionRequested, @Nullable FieldLayoutItem fieldLayoutItem) { JiraDurationUtils jiraDurationUtils = ComponentAccessor.getComponent(JiraDurationUtils.class); String originalEstimate = issue.getOriginalEstimate() == null ? null : jiraDurationUtils.getShortFormattedDuration(issue.getOriginalEstimate()); String estimate = issue.getEstimate() == null ? null : jiraDurationUtils.getShortFormattedDuration(issue.getEstimate()); String timeSpent = issue.getTimeSpent() == null ? null : jiraDurationUtils.getShortFormattedDuration(issue.getTimeSpent()); TimeTrackingJsonBean timeTrackingJsonBean = TimeTrackingJsonBean.shortBean(originalEstimate, estimate, timeSpent, issue.getOriginalEstimate(), issue.getEstimate(), issue.getTimeSpent()); if (renderedVersionRequested) { String renderedOriginalEstimate = issue.getOriginalEstimate() == null ? null : jiraDurationUtils.getFormattedDuration(issue.getOriginalEstimate(), authenticationContext.getLocale()); String renderedEstimate = issue.getEstimate() == null ? null : jiraDurationUtils.getFormattedDuration(issue.getEstimate(), authenticationContext.getLocale()); String renderedTimeSpent = issue.getTimeSpent() == null ? null : jiraDurationUtils.getFormattedDuration(issue.getTimeSpent(), authenticationContext.getLocale()); TimeTrackingJsonBean renderedTimeTrackingJsonBean = TimeTrackingJsonBean.shortBean(renderedOriginalEstimate, renderedEstimate, renderedTimeSpent, issue.getOriginalEstimate(), issue.getEstimate(), issue.getTimeSpent()); return new FieldJsonRepresentation(new JsonData(timeTrackingJsonBean), new JsonData(renderedTimeTrackingJsonBean)); } else { return new FieldJsonRepresentation(new JsonData(timeTrackingJsonBean)); } }