Package java.text

Examples of java.text.SimpleDateFormat.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 );
    }
    /**
     * Create a PageHelper.  Note that will have no values
View Full Code Here


        {
            return formatter.parse( date );
        }
        catch ( ParseException e )
        {
            throw new MojoExecutionException( "Please use this date pattern: " + formatter.toLocalizedPattern(), e );
        }
    }

    public ScmRepository getScmRepository()
        throws ScmException
View Full Code Here

                                LOG.error("Unparsable date: {}", prop.getValue(), e);
                            }
                        }

                        field = new DateTimeFieldPanel("value", label.getDefaultModelObjectAsString(),
                                new Model(parsedDate), df.toLocalizedPattern());
                        break;

                    case Enum:
                        MapChoiceRenderer<String, String> enumCR =
                                new MapChoiceRenderer<String, String>(prop.getEnumValues());
View Full Code Here

                                LOG.error("Unparsable date: {}", prop.getValue(), e);
                            }
                        }

                        field = new DateTimeFieldPanel("value", label.getDefaultModelObjectAsString(),
                                new Model(parsedDate), df.toLocalizedPattern());
                        break;

                    case Enum:
                        MapChoiceRenderer<String, String> enumCR =
                                new MapChoiceRenderer<String, String>(prop.getEnumValues());
View Full Code Here

      ((time == null) ? "" : (" "+time.toString()));
  DateFormat df = DateFormat.getDateInstance(
      DateFormat.SHORT, GuiUtil.getLocale());
  if ((time != null) && (df instanceof SimpleDateFormat)) {
      SimpleDateFormat fmt = (SimpleDateFormat)df;
      String formatPrefix = fmt.toLocalizedPattern();
      try {
    // Try w/ HH:mm:ss.SSS
    date = parseDateString(
        fmt, formatPrefix+TIME_FORMAT, dateTime);
      } catch (ParseException ex) {
View Full Code Here

    public static String formatDateForDisplay(Locale locale, Date date) {
  DateFormat dateFormat = DateFormat.getDateInstance(
      DateFormat.MEDIUM, locale);
  if (dateFormat instanceof SimpleDateFormat) {
      SimpleDateFormat fmt = (SimpleDateFormat)dateFormat;
      fmt.applyLocalizedPattern(fmt.toLocalizedPattern()+TIME_FORMAT);
      return fmt.format(date);
  } else {
      dateFormat = DateFormat.getDateTimeInstance(
    DateFormat.MEDIUM, DateFormat.LONG, locale);
      return dateFormat.format(date);
View Full Code Here

                + ((time == null) ? "" : (" " + time.toString()));
        DateFormat df = DateFormat.getDateInstance(
                DateFormat.SHORT, GuiUtil.getLocale());
        if ((time != null) && (df instanceof SimpleDateFormat)) {
            SimpleDateFormat fmt = (SimpleDateFormat) df;
            String formatPrefix = fmt.toLocalizedPattern();
            try {
                // Try w/ HH:mm:ss.SSS
                date = parseDateString(
                        fmt, formatPrefix + TIME_FORMAT, dateTime);
            } catch (ParseException ex) {
View Full Code Here

    public static String formatDateForDisplay(Locale locale, Date date) {
        DateFormat dateFormat = DateFormat.getDateInstance(
                DateFormat.MEDIUM, locale);
        if (dateFormat instanceof SimpleDateFormat) {
            SimpleDateFormat fmt = (SimpleDateFormat) dateFormat;
            fmt.applyLocalizedPattern(fmt.toLocalizedPattern() + TIME_FORMAT);
            return fmt.format(date);
        } else {
            dateFormat = DateFormat.getDateTimeInstance(
                    DateFormat.MEDIUM, DateFormat.LONG, locale);
            return dateFormat.format(date);
View Full Code Here

      ((time == null) ? "" : (" "+time.toString()));
  DateFormat df = DateFormat.getDateInstance(
      DateFormat.SHORT, GuiUtil.getLocale());
  if ((time != null) && (df instanceof SimpleDateFormat)) {
      SimpleDateFormat fmt = (SimpleDateFormat)df;
      String formatPrefix = fmt.toLocalizedPattern();
      try {
    // Try w/ HH:mm:ss.SSS
    date = parseDateString(
        fmt, formatPrefix+TIME_FORMAT, dateTime);
      } catch (ParseException ex) {
View Full Code Here

    public static String formatDateForDisplay(Locale locale, Date date) {
  DateFormat dateFormat = DateFormat.getDateInstance(
      DateFormat.MEDIUM, locale);
  if (dateFormat instanceof SimpleDateFormat) {
      SimpleDateFormat fmt = (SimpleDateFormat)dateFormat;
      fmt.applyLocalizedPattern(fmt.toLocalizedPattern()+TIME_FORMAT);
      return fmt.format(date);
  } else {
      dateFormat = DateFormat.getDateTimeInstance(
    DateFormat.MEDIUM, DateFormat.LONG, locale);
      return dateFormat.format(date);
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.