Package org.joda.time.format

Examples of org.joda.time.format.DateTimeFormatterBuilder.appendLiteral()


    for(int i=0;i<patterns.length();++i) {
      if(patterns.charAt(i)=='%' && i+1 < patterns.length()) {
        char specifier = patterns.charAt(++i);
        switch(specifier) {
        case '%':
          builder.appendLiteral("%");
          break;
        case 'a':
          // Abbreviated weekday name in the current locale. (Also matches
          // full name on input.)
          builder.appendDayOfWeekShortText();
View Full Code Here


          // and *not* with ‘%H’.  An empty string in some locales.
          builder.appendHalfdayOfDayText();
          break;
        case 'O':
          if(i+1>=patterns.length()) {
            builder.appendLiteral("%O");
          } else {
            switch(patterns.charAt(++i)) {
            case 'S':
              // Specific to R is ‘%OSn’, which for output gives the seconds to ‘0
              // <= n <= 6’ decimal places (and if ‘%OS’ is not followed by a
View Full Code Here

          break;
        default:
          throw new EvalException("%" + specifier + " not yet implemented. (Implement me!)");
        }
      } else {
        builder.appendLiteral(patterns.substring(i,i+1));
      }
    }
    if(useTz) {
      builder.appendLiteral(" ");
      builder.appendTimeZoneShortName();
View Full Code Here

      } else {
        builder.appendLiteral(patterns.substring(i,i+1));
      }
    }
    if(useTz) {
      builder.appendLiteral(" ");
      builder.appendTimeZoneShortName();
    }
    return builder.toFormatter();
  }
 
View Full Code Here

      boolean hasDate = appendDateFormats(builder, flags);
      if (poy != null) {
        if (!JodaTimeUtils.hasField(base, DateTimeFieldType.monthOfYear())) {
          // Assume poy is compatible with whatever was built and
          // poy.toISOString() does the correct thing
          builder.appendLiteral("-");
          builder.appendLiteral(poy.toISOString());
          hasDate = true;
        }
      }
      if (dow != null) {
View Full Code Here

      if (poy != null) {
        if (!JodaTimeUtils.hasField(base, DateTimeFieldType.monthOfYear())) {
          // Assume poy is compatible with whatever was built and
          // poy.toISOString() does the correct thing
          builder.appendLiteral("-");
          builder.appendLiteral(poy.toISOString());
          hasDate = true;
        }
      }
      if (dow != null) {
        if (!JodaTimeUtils.hasField(base, DateTimeFieldType.monthOfYear()) && !JodaTimeUtils.hasField(base, DateTimeFieldType.dayOfWeek())) {
View Full Code Here

          hasDate = true;
        }
      }
      if (dow != null) {
        if (!JodaTimeUtils.hasField(base, DateTimeFieldType.monthOfYear()) && !JodaTimeUtils.hasField(base, DateTimeFieldType.dayOfWeek())) {
          builder.appendLiteral("-");
          builder.appendLiteral(dow.toISOString());
          hasDate = true;
        }
      }
      if (hasTime()) {
View Full Code Here

        }
      }
      if (dow != null) {
        if (!JodaTimeUtils.hasField(base, DateTimeFieldType.monthOfYear()) && !JodaTimeUtils.hasField(base, DateTimeFieldType.dayOfWeek())) {
          builder.appendLiteral("-");
          builder.appendLiteral(dow.toISOString());
          hasDate = true;
        }
      }
      if (hasTime()) {
        if (!hasDate) {
View Full Code Here

        if (!hasDate) {
          builder.clear();
        }
        // Assume tod is compatible with whatever was built and
        // tod.toISOString() does the correct thing
        builder.appendLiteral("T");
        builder.appendLiteral(tod.toISOString());
      }
      return builder.toFormatter();
    }
View Full Code Here

          builder.clear();
        }
        // Assume tod is compatible with whatever was built and
        // tod.toISOString() does the correct thing
        builder.appendLiteral("T");
        builder.appendLiteral(tod.toISOString());
      }
      return builder.toFormatter();
    }

    @Override
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.