Package java.text

Examples of java.text.SimpleDateFormat.toPattern()


                // we initialize a localized ISO date format above to be safe

                // Default to ISO format
                simpleDateFormat = isoDateFormat;
            }
            pattern = simpleDateFormat.toPattern();
        }

        // Validate the pattern
        int yearIndex = pattern.indexOf('y');
        int monthIndex = pattern.indexOf('M');
View Full Code Here


        }else if(!activityDate.isEmpty()){
            SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yy");

            boolean error = false;
           
            if (activityDate.trim().length() != dateFormat.toPattern().length())
            {
                log.error("Activity date has invalid format.");
                error = true;
           
View Full Code Here

        {

            if(popupDateFormat == null)
            {
                SimpleDateFormat defaultDateFormat = createStandardDateFormat(facesContext);
                popupDateFormat = defaultDateFormat.toPattern();
            }

            return popupDateFormat;
        }
View Full Code Here

      dateFormat = (SimpleDateFormat) DateFormat.getDateTimeInstance(
          DATE_STYLE, TIME_STYLE, LOCALE);
     
      // not all date patterns includes era, full year, timezone and second,
      // so we add them here
      dateFormat.applyPattern(dateFormat.toPattern() + " G s Z yyyy");
      dateFormat.setTimeZone(TIMEZONE);
     
      DATE_FORMAT = new NumberDateFormat(dateFormat);
     
      do {
View Full Code Here

        {

            if(popupDateFormat == null)
            {
                SimpleDateFormat defaultDateFormat = createStandardDateFormat(facesContext);
                popupDateFormat = defaultDateFormat.toPattern();
            }

            return popupDateFormat;
        }
View Full Code Here

        {

            if(popupDateFormat == null)
            {
                SimpleDateFormat defaultDateFormat = createStandardDateFormat(facesContext);
                popupDateFormat = defaultDateFormat.toPattern();
            }

            return popupDateFormat;
        }
View Full Code Here

        if (shortDateFormat instanceof SimpleDateFormat)
        {
            SimpleDateFormat simpleDateFormat = (SimpleDateFormat) shortDateFormat;

            String pattern = simpleDateFormat.toPattern();

            String revised = pattern.replaceAll("([^y])yy$", "$1yyyy");

            return new SimpleDateFormat(revised);
        }
View Full Code Here

            {
              final SimpleDateFormat df = (SimpleDateFormat) subFormats[sdf];

              final String[] fields = fmt.getFields();
              visualElement.setAttribute(CORE_NAMESPACE, FIELD_ATTRIBUTE, fields[sdf]);
              visualElement.setAttribute(CORE_NAMESPACE, FORMAT_ATTRIBUTE, df.toPattern());
            }
          }
          else if (targetElementType instanceof NumberFieldType)
          {
            final int sdf = findFirstNumberFormat(subFormats);
View Full Code Here

            {
              final DecimalFormat df = (DecimalFormat) subFormats[sdf];

              final String[] fields = fmt.getFields();
              visualElement.setAttribute(CORE_NAMESPACE, FIELD_ATTRIBUTE, fields[sdf]);
              visualElement.setAttribute(CORE_NAMESPACE, FORMAT_ATTRIBUTE, df.toPattern());
            }
          }
          else
          {
            final String[] fields = fmt.getFields();
View Full Code Here

    }
  private static int getDateTimeSubType(Cell cell) {
        if (DateUtil.isCellDateFormatted(cell)) {
          //check if a pure time format
          SimpleDateFormat format = (SimpleDateFormat) DataFormatter.getJavaFormat(cell, ZssContext.getCurrent().getLocale()); //ZSS-69
          final String pattern = format.toPattern();
          return isDatePattern(pattern) ? Step.DATE : Step.TIME; //a date or a time
        }
        return Step.NUMBER; //a nubmer
  }
  private static class StepChunk {
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.