Package java.text

Examples of java.text.SimpleDateFormat.toLocalizedPattern()


      {
  harness.debug(e);
  harness.check(false);
      }
    local = format.getDateFormatSymbols().getLocalPatternChars();
    harness.check(format.toLocalizedPattern(), localizedPattern,
      "Localized pattern comes back as is with " +
      "toLocalizedPattern().");
    harness.check(format.toPattern(), pattern,
      "Localized pattern comes back standardised with " +
      "toPattern().");
View Full Code Here


   * @param harness  the test harness (<code>null</code> not allowed).
   */
  public void test(TestHarness harness)
  {
    SimpleDateFormat f = new SimpleDateFormat("yyyy", Locale.CHINA);
    harness.check(f.toLocalizedPattern(), "aaaa");
    f.applyPattern("d-MMM-yyyy");
    harness.check(f.toLocalizedPattern(), "j-nnn-aaaa");
  }

}
View Full Code Here

  public void test(TestHarness harness)
  {
    SimpleDateFormat f = new SimpleDateFormat("yyyy", Locale.CHINA);
    harness.check(f.toLocalizedPattern(), "aaaa");
    f.applyPattern("d-MMM-yyyy");
    harness.check(f.toLocalizedPattern(), "j-nnn-aaaa");
  }

}
View Full Code Here

     * @param locale Locale
     * @return Patter of passed style and locale. i.e "M/d/yy"
     */
    public static String getDateFormatLocalizedPattern(int style, Locale locale) {
        final SimpleDateFormat df = (SimpleDateFormat) SimpleDateFormat.getDateInstance(style, locale);
        return df.toLocalizedPattern();
    }

    /**
     * Return the pattern of a certain date style using current locale.
     * @param style Date format style. i.e. DateFormat.SHORT
View Full Code Here

            final DecimalFormat df = (DecimalFormat) format;
            return localized ? df.toLocalizedPattern() : df.toPattern();
        }
        if (format instanceof SimpleDateFormat) {
            final SimpleDateFormat df = (SimpleDateFormat) format;
            return localized ? df.toLocalizedPattern() : df.toPattern();
        }
        if (format instanceof AngleFormat) {
            return ((AngleFormat) format).toPattern();
        }
        return null;
View Full Code Here

        writer.beginEmpty("input");
        writer.attribute("type", "text");
        writer.attribute("name", name);
        writer.attribute("value", value);
        writer.attribute("title", format.toLocalizedPattern());

        if (disabled)
            writer.attribute("disabled", "disabled");

        renderIdAttribute(writer, cycle);
View Full Code Here

            _script.execute(cycle, pageRenderSupport, symbols);

            writer.beginEmpty("input");
            writer.attribute("type", "text");
            writer.attribute("name", name);
            writer.attribute("title", formatter.toLocalizedPattern());

            if (value != null)
                writer.attribute("value", formatter.format(value));

            if (disabled)
View Full Code Here

            _script.execute(cycle, body, symbols);

            writer.beginEmpty("input");
            writer.attribute("type", "text");
            writer.attribute("name", name);
            writer.attribute("title", formatter.toLocalizedPattern());

            if (value != null)
                writer.attribute("value", formatter.format(value));

            if (disabled)
View Full Code Here

        // date formats need to be run through the Localized
        // SimpleDateFormat and pulled back out as localized patterns.
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd", locale)
        sdf.setTimeZone( (TimeZone)ctx.get("timezone") );   
        ctx.put("plainFormat",     sdf.toLocalizedPattern());
       
        sdf.applyPattern("EEEE MMMM dd, yyyy");
        ctx.put("toStringFormat",  sdf.toLocalizedPattern());
       
        sdf.applyPattern("MMM dd yyyy, hh:mm:ss a z");
View Full Code Here

        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd", locale)
        sdf.setTimeZone( (TimeZone)ctx.get("timezone") );   
        ctx.put("plainFormat",     sdf.toLocalizedPattern());
       
        sdf.applyPattern("EEEE MMMM dd, yyyy");
        ctx.put("toStringFormat",  sdf.toLocalizedPattern());
       
        sdf.applyPattern("MMM dd yyyy, hh:mm:ss a z");
        ctx.put("timestampFormat", sdf.toLocalizedPattern());
       
        ctx.put("dateFormatter", sdf );
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.