Package org.joda.time.format

Examples of org.joda.time.format.DateTimeFormatter.withLocale()


            if (model.getUnit() == DateTime.class) {
                DateTime d = new DateTime(new Date((long) v));
                if (d != null) {

                    DateTimeFormatter fmt = DateTimeFormat.forPattern("dd/MM/yyyy HH:mm:ss");
                    str = fmt.withLocale(LOCALE).print(d);
                    strw = (int) (settings.tip.fontMetrics.getStringBounds(str, null)).getWidth() + 4;
                }
            } else {
                str = new Double(v).toString();
                strw = (int) (settings.tip.fontMetrics.getStringBounds(str, null)).getWidth() + 4;
View Full Code Here


            formatter = DateTimeFormat.forStyle(format);
        } else {
            formatter = DateTimeFormat.forPattern(format);
        }
        if (_locale != null) {
            formatter = formatter.withLocale(_locale);
        }
        formatter = formatter.withZone(_formatter.getZone());
        return new JacksonJodaFormat(this, formatter);
    }
   
View Full Code Here

        DateTimeFormatter formatter = _formatter;
       
        if (!_explicitLocale) {
            Locale loc = provider.getLocale();
            if (loc != null && !loc.equals(_locale)) {
                formatter = formatter.withLocale(loc);
            }
        }
        if (!_explicitTimezone) {
            TimeZone tz = provider.getTimeZone();
            if (tz != null && !tz.equals(_jdkTimezone)) {
View Full Code Here

        if (!(val instanceof DateTime)) return null;
        DateTimeFormatter fmt;
        if (null != pattern) fmt = DateTimeFormat.forPattern(pattern);
        else fmt = DateTimeFormat.fullDateTime();

        fmt = fmt.withLocale(locale);
        if (null != timezone) {
            DateTimeZone dtz = DateTimeZone.forID(timezone);
            fmt = fmt.withZone(dtz);
        }
        return fmt.print((DateTime)val);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.