public static String prettyTime(LocalDateTime date, Locale locale) {
        if (date == null) {
            return null;
        }
        String keyPrefix = locale.getLanguage().equals("zh") ? "zh" : "us";
        long diff = Duration.between(date, LocalDateTime.now()).toMillis() / 1000;
        int amount;

        /**
         * Second counts
         * 3600: hour
         * 86400: day
         * 604800: week
         * 2592000: month
         * 31536000: year
         */
        if (diff >= 31536000) {
            amount = (int) (diff / 31536000);
            if (amount == 1) {
                return PRETTY_TIME_I18N.get(keyPrefix + "_LAST_YEAR");
            }
            return amount + PRETTY_TIME_I18N.get(keyPrefix + "_YEARS");
        } else if (diff >= 2592000) {
            amount = (int) (diff / 2592000);
            if (amount == 1) {
                return PRETTY_TIME_I18N.get(keyPrefix + "_LAST_MONTH");
            }
            return amount + PRETTY_TIME_I18N.get(keyPrefix + "_MONTHS");
        } else if (diff >= 604800) {
            amount = (int) (diff / 604800);
            if (amount == 1) {
                return PRETTY_TIME_I18N.get(keyPrefix + "_LAST_WEEK");
            }
            return amount + PRETTY_TIME_I18N.get(keyPrefix + "_WEEKS");
        } else if (diff >= 86400) {
            amount = (int) (diff / 86400);
            if (amount == 1) {
                return PRETTY_TIME_I18N.get(keyPrefix + "_YESTERDAY");
            }
            return amount + PRETTY_TIME_I18N.get(keyPrefix + "_DAYS");
        } else if (diff >= 3600) {
            amount = (int) (diff / 3600);
            return amount + PRETTY_TIME_I18N.get(keyPrefix + "_HOURS");
        } else if (diff >= 60) {
            amount = (int) (diff / 60);
            return amount + PRETTY_TIME_I18N.get(keyPrefix + "_MINUTES");
        } else {
            amount = (int) diff;
            if (amount < 6) {
                return PRETTY_TIME_I18N.get(keyPrefix + "_JUST_NOW");
            } else {
                return amount + PRETTY_TIME_I18N.get(keyPrefix + "_SECONDS");
            }
        }
    }
@Test
    public void testPrettyTime() {
        Assert.assertEquals("去年", DateKit.prettyTime(LocalDateTime.now().plusYears(-1), Locale.CHINESE));
        Assert.assertEquals("上个月", DateKit.prettyTime(LocalDateTime.now().plusMonths(-1), Locale.CHINESE));
        Assert.assertEquals("上周", DateKit.prettyTime(LocalDateTime.now().plusWeeks(-1), Locale.CHINESE));
        Assert.assertEquals("昨天", DateKit.prettyTime(LocalDateTime.now().plusDays(-1), Locale.CHINESE));
        Assert.assertEquals("1小时前", DateKit.prettyTime(LocalDateTime.now().plusHours(-1), Locale.CHINESE));
        Assert.assertEquals("1分钟前", DateKit.prettyTime(LocalDateTime.now().plusMinutes(-1), Locale.CHINESE));
        Assert.assertEquals("刚刚", DateKit.prettyTime(LocalDateTime.now().plusSeconds(-1), Locale.CHINESE));
        Assert.assertEquals("10秒前", DateKit.prettyTime(LocalDateTime.now().plusSeconds(-10), Locale.CHINESE));
    }