break; case (DateTickUnit.MONTH) : result = calculateDateForPosition(new Month(time, this.timeZone, this.locale), position); break; case(DateTickUnit.YEAR) : result = calculateDateForPosition(new Year(time, this.timeZone, this.locale), position); break;
Month month = new Month(calendar.getTime(), this.timeZone, this.locale); Date standardDate = calculateDateForPosition( month, this.tickMarkPosition); long millis = standardDate.getTime(); standardDate = calculateDateForPosition( month, this.tickMarkPosition);
/** * Corrects the given tick date for the position setting. * * @param time the tick date/time. * @param unit the tick unit. * @param position the tick position. * * @return The adjusted time. */ private Date correctTickDateForPosition(Date time, DateTickUnit unit, DateTickMarkPosition position) { Date result = time; if (unit.getUnitType().equals(DateTickUnitType.MONTH)) { result = calculateDateForPosition(new Month(time, this.timeZone, this.locale), position); } else if (unit.getUnitType().equals(DateTickUnitType.YEAR)) { result = calculateDateForPosition(new Year(time, this.timeZone, this.locale), position); } return result; }
Month month = new Month(calendar.getTime(), this.timeZone, this.locale); Date standardDate = calculateDateForPosition( month, this.tickMarkPosition); long millis = standardDate.getTime(); standardDate = calculateDateForPosition( month, this.tickMarkPosition);