@Override public DateTimeUnit fromIso( Date date ) { return fromIso( DateTimeUnit.fromJdkDate( date ) ); }
@Override public DateTimeUnit toIso( int year, int month, int day ) { return toIso( new DateTimeUnit( year, month, day ) ); }
/** * Returns the start date for the given year, inclusive. * * @param calendar the calendar to base the date on. * @param year the year. * @return the start date. */ public static Date getStartDate( Calendar calendar, Integer year ) { return calendar.isoStartOfYear( year ).toJdkDate(); }
public DateTimeUnit( DateTimeUnit dateTimeUnit ) { this( dateTimeUnit.isIso8601() ); this.year = dateTimeUnit.getYear(); this.month = dateTimeUnit.getMonth(); this.day = dateTimeUnit.getDay(); this.dayOfWeek = dateTimeUnit.getDayOfWeek(); }
@Override public DateTimeUnit fromIso( int year, int month, int day ) { return fromIso( new DateTimeUnit( year, month, day, true ) ); }
@Override public DateTimeUnit isoStartOfYear( int year ) { return new DateTimeUnit( year, 1, 1 ); }
@Override public DateInterval toInterval( DateIntervalType type, int offset, int length ) { return toInterval( today(), type, offset, length ); }
@Override public DateInterval parse( String period ) { return parse( getCalendar(), period ); }
@Override public DateTimeUnit getDateWithOffset( DateTimeUnit dateTimeUnit, int offset, Calendar calendar ) { return calendar.plusMonths( dateTimeUnit, offset * 6 ); }
@Override public DateTimeUnit getDateWithOffset( DateTimeUnit dateTimeUnit, int offset, Calendar calendar ) { return calendar.plusYears( dateTimeUnit, offset ); }
@Override public DateInterval toInterval( DateTimeUnit dateTimeUnit, DateIntervalType type ) { return toInterval( dateTimeUnit, type, 0, 1 ); }
@Override public DateTimeUnit fromIso( DateTimeUnit dateTimeUnit ) { return super.fromIso( dateTimeUnit ); }
@Override public int week( DateTimeUnit dateTimeUnit ) { return isoWeek( dateTimeUnit ); }
@Override public DateTimeUnit getDateWithOffset( DateTimeUnit dateTimeUnit, int offset, Calendar calendar ) { return calendar.plusWeeks( dateTimeUnit, offset ); }
public DateTimeUnit( DateTimeUnit dateTimeUnit, boolean iso8601 ) { this( iso8601 ); this.year = dateTimeUnit.getYear(); this.month = dateTimeUnit.getMonth(); this.day = dateTimeUnit.getDay(); this.dayOfWeek = dateTimeUnit.getDayOfWeek(); }
/** * @param year the year starting at AD 1. * @param month the month starting at 1. * @param day the day of the month starting at 1. * @param iso8601 is this period an iso period */ public Cal( int year, int month, int day, boolean iso8601 ) { dateTimeUnit = new DateTimeUnit( year, month, day, iso8601 ); }
@Override public DateTimeUnit getDateWithOffset( DateTimeUnit dateTimeUnit, int offset, Calendar calendar ) { return calendar.plusMonths( dateTimeUnit, 2 * offset ); }