private static Component generateProgressBar(IDatesMapper datesMapper, LimitingResourceQueueElement queueElement) {

        DateAndHour advancementEndDate = getAdvanceEndDate(queueElement);

        if ( advancementEndDate == null ) {
            return null;
        }

        Duration durationBetween = new Duration(
                queueElement.getStartTime().toDateTime().getMillis(), advancementEndDate.toDateTime().getMillis());

        Div progressBar = new Div();

        if ( !queueElement.getStartDate().isEqual(advancementEndDate.getDate()) ) {
            progressBar.setWidth(datesMapper.toPixels(durationBetween) + "px");
            progressBar.setSclass("queue-progress-bar");
        }

        return progressBar;
    }
 private static int getWidthPixels(IDatesMapper datesMapper, LimitingResourceQueueElement queueElement) {
     return datesMapper.toPixels(queueElement.getLengthBetween());
 }