@Override public String toString() { return "CalendarDay{" + date.getYear() + "-" + date.getMonthValue() + "-" + date.getDayOfMonth() + "}"; }
/** * Get the year * * @return the year for this day */ public int getYear() { return date.getYear(); }
/** * {@inheritDoc} */ @Override public CharSequence format(final DayOfWeek dayOfWeek) { return weekDayLabels[dayOfWeek.getValue() - 1]; } }
MockRetryingFuture() { this(Duration.ofSeconds(5)); }
@Override public Instant instant() { return Instant.ofEpochMilli(currentTimeMillis); } }
public Instant now() { return Instant.now(); } }
/** * @param year new instance's year * @param month new instance's month as defined by {@linkplain java.util.Calendar} * @param day new instance's day of month */ private CalendarDay(final int year, final int month, final int day) { date = LocalDate.of(year, month, day); }
/** * Get the day * * @return the day of the month for this day */ public int getDay() { return date.getDayOfMonth(); }
/** * Get the month, represented by values from {@linkplain LocalDate} * * @return the month of the year as defined by {@linkplain LocalDate} */ public int getMonth() { return date.getMonthValue(); }
@Override public void onBindViewHolder(EntryViewHolder holder, int position) { //set selected date to today holder.calendarView.setSelectedDate(LocalDate.now()); }
private Instant getScheduledTime() { return creationTime.plus(delay); }
@Override public int indexOf(final CalendarDay day) { return (int) Period .between(min.getDate().withDayOfMonth(1), day.getDate().withDayOfMonth(1)) .toTotalMonths(); }
@Override protected void buildDayViews( final Collection<DayView> dayViews, final LocalDate calendar) { LocalDate temp = calendar; for (int r = 0; r < DEFAULT_MAX_WEEKS; r++) { for (int i = 0; i < DEFAULT_DAYS_IN_WEEK; i++) { addDayView(dayViews, temp); temp = temp.plusDays(1); } } }
@Override public int compareAsc(@NonNull Repository lhs, @NonNull Repository rhs) { return lhs.updated_at.compareTo(rhs.updated_at); } }
@Override public CalendarDay getItem(final int position) { return CalendarDay.from(min.getDate().plusMonths(position)); } }
/** * {@inheritDoc} */ @Override public CharSequence format(final DayOfWeek dayOfWeek) { return dayOfWeek.getDisplayName(TextStyle.SHORT, Locale.getDefault()); } }
@Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(date.getYear()); dest.writeInt(date.getMonthValue()); dest.writeInt(date.getDayOfMonth()); }
Instant instant() { return Instant.now(); } }
@Override protected void buildDayViews( final Collection<DayView> dayViews, final LocalDate calendar) { LocalDate temp = calendar; for (int i = 0; i < DEFAULT_DAYS_IN_WEEK; i++) { addDayView(dayViews, temp); temp = temp.plusDays(1); } }
@Override public int hashCode() { return hashCode(date.getYear(), date.getMonthValue(), date.getDayOfMonth()); }