Code example for TimeUnit

Methods: toDays

0
            super(locale);
        } 
 
        @Override 
        public boolean canHandle(final Date date, final long delta) {
            long deltaDays = TimeUnit.MILLISECONDS.toDays(delta);
            return (deltaDays <= 6) ? true : false;
        } 
 
        @Override 
        public String format(final Date date, final long delta) {
            String sDay = new SimpleDateFormat("EEEE", locale).format(date);
            return format("WeekPattern", sDay, Dates.formatTimeShort(date));
        } 
    } 
 
    public static class Default extends AbstractDateHandler { 
 
        public Default(Locale locale) {
            super(locale);
        }