public String getDuration(final Long duration, final Locale locale, final JiraDurationUtils utils) { if (duration != null) { return utils.getShortFormattedDuration(duration, locale); } return null; }
private String formatMillisIntoDisplayFormat(final Long estimate) { if (estimate == null) { return null; } //Note: we want English locale to format to w d h m correctly return jiraDurationUtils.getShortFormattedDuration(estimate, new Locale("en_UK")); }
public String shortFormat(Long duration) { if (duration == null) { return "-"; } duration = Math.abs(duration.longValue()); return jiraDurationUtils.getShortFormattedDuration(duration); } }
public String generateSectionLabel(PieDataset dataset, Comparable key) { Number value = dataset.getValue(key); String timeInDays = jiraDurationUtils.getShortFormattedDuration(value.longValue()); return key + ": " + timeInDays; } });
public String generateToolTip(PieDataset dataset, Comparable key) { int convertToSec = 1; Number number = dataset.getValue(key); return key + ": " + jiraDurationUtils.getShortFormattedDuration(convertToSec * (number.longValue())) + " (" + (100 * number.longValue() / totalWorkload) + "%)"; } });
reportParams.put( KEY_TOTAL_WORK_HOURS, jiraDurationUtils.getShortFormattedDuration((Long) workloadPieChart.getParameters().get(KEY_TOTAL_WORK_HOURS)) );
private void performEditOperation(TimeTrackingJsonBean timeTrackingJsonBean, IssueInputParameters inputParameters, Issue issue, ErrorCollection errors) String currentEstimate = issue.getEstimate() == null ? null : jiraDurationUtils.getShortFormattedDuration(issue.getEstimate()); String currentOriginalEstimate = issue.getOriginalEstimate() == null ? null : jiraDurationUtils.getShortFormattedDuration(issue.getOriginalEstimate());
public void populateCurrentValue(final IssueInputParameters inputParameters, final CopyIssueBean bean, final FieldLayoutItem fieldLayoutItem, final Project project) { TimeTrackingBean timeTracking = bean.getTimeTracking(); if (timeTrackingConfiguration.enabled() && timeTracking != null) { final Long originalEstimate = timeTracking.getOriginalEstimate(); if(originalEstimate != null){ final JiraDurationUtils durutil = ComponentAccessor.getComponent(JiraDurationUtils.class); final String formattedValue = durutil.getShortFormattedDuration(originalEstimate); if (timeTrackingConfiguration.getMode().equals(TimeTrackingConfiguration.Mode.LEGACY)) { inputParameters.getActionParameters().put(IssueFieldConstants.TIMETRACKING, toArr(formattedValue)); } else { inputParameters.getActionParameters().put(TimeTrackingSystemField.TIMETRACKING_ORIGINALESTIMATE, toArr(formattedValue)); inputParameters.getActionParameters().put(TimeTrackingSystemField.TIMETRACKING_REMAININGESTIMATE, toArr(formattedValue)); } } } }
getProjectNameOrFilterTitle(projectOrFilterId), getFilterUrl(params), jiraDurationUtils.getShortFormattedDuration((Long) theChart.getParameters().get(KEY_TOTAL_WORK_HOURS)), statisticType, issueTimeType, workloadPieChartJson.timeSpent = jiraDurationUtils.getShortFormattedDuration((Long) theChart.getParameters().get(KEY_TOTAL_WORK_HOURS));
@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)); } }