中文年份显示问题


ModelFormField  2000

//DateFormat dateFormatter = DateFormat.getDateInstance(DateFormat.SHORT, locale);
                    DateFormat dateFormatter = DateFormat.getDateInstance(DateFormat.SHORT, locale);
                    /**
                     * fix china chinese date display
                     */
            if(locale.equals(Locale.CHINA)||locale.equals(Locale.CHINESE)){
            dateFormatter = DateFormat.getDateInstance(DateFormat.DEFAULT, locale);
            }

UtilDateTime 988

public static DateFormat toDateTimeFormat(String dateTimeFormat, TimeZone tz, Locale locale) {
        DateFormat df = null;
        if (UtilValidate.isEmpty(dateTimeFormat)) {
            df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM, locale);
            /**
             * fix china chinese date display
             */
    if(locale.equals(Locale.CHINA)||locale.equals(Locale.CHINESE)){
    df = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.MEDIUM, locale);
    }
        } else {
            df = new SimpleDateFormat(dateTimeFormat);
        }
        df.setTimeZone(tz);
        return df;
    }

猜你喜欢

转载自jiasudu.iteye.com/blog/1743542
今日推荐