Examples of DateConverter


Examples of hirondelle.web4j.request.DateConverter

      return calendar.getTime();
    }

    private void testFormatDateTime(String aDateTime, String aExpected){
      DateTime dt = new DateTime(aDateTime);
      DateConverter converter = new DateConverterImpl();
      String actual = converter.formatEyeFriendlyDateTime(dt, null);
      if(!actual.equals(aExpected)){
        fail("Actual:'"+ actual + "' Expected:'" + aExpected + "'");
      }
    }
View Full Code Here

Examples of hirondelle.web4j.request.DateConverter

      }
    }
   
    private void testParseEyeDateTime(String aInput, String aExpected){
      DateTime expected = new DateTime(aExpected);
      DateConverter converter = new DateConverterImpl();
      DateTime actual = converter.parseEyeFriendlyDateTime(aInput, null);
      if(!actual.equals(expected)){
        fail("Actual:" + actual + " Expected:" + aExpected);
      }
    }
View Full Code Here

Examples of hirondelle.web4j.request.DateConverter

      }
    }
   
    private void testParseHandDateTime(String aInput, String aExpected){
      DateTime expected = new DateTime(aExpected);
      DateConverter converter = new DateConverterImpl();
      DateTime actual = converter.parseHandFriendlyDateTime(aInput, null);
      if(actual == null){
        fail("Failed to parse the input '" + aInput + "'");
      }
      else if(!actual.equals(expected)){
        fail("Actual:" + actual + " Expected:" + aExpected);
View Full Code Here

Examples of hirondelle.web4j.request.DateConverter

  }
 
 
  private Date parseDate(String aUserInputValue, Locale aLocale, TimeZone aTimeZone) throws ModelCtorException {
    Date result = null;
    DateConverter dateConverter = BuildImpl.forDateConverter();
    result = dateConverter.parseHandFriendly(aUserInputValue, aLocale, aTimeZone);
    if ( result == null ){
      result = dateConverter.parseEyeFriendly(aUserInputValue, aLocale, aTimeZone);
    }
    if ( result == null ) {
      throw PROBLEM_FOUND;
    }
    return result;
View Full Code Here

Examples of hirondelle.web4j.request.DateConverter

    return result;
  }
 
  private DateTime parseDateTime(String aUserInputValue, Locale aLocale) throws ModelCtorException {
    DateTime result = null;
    DateConverter dateConverter = BuildImpl.forDateConverter();
    result = dateConverter.parseHandFriendlyDateTime(aUserInputValue, aLocale);
    if ( result == null ){
      result = dateConverter.parseEyeFriendlyDateTime(aUserInputValue, aLocale);
    }
    if ( result == null ) {
      throw PROBLEM_FOUND;
    }
    return result;
View Full Code Here

Examples of hirondelle.web4j.request.DateConverter

    if( fDateObjectMissing ) return result;
   
    Locale locale = getLocale();
    TimeZone timeZone = getTimeZone();
    if(fDateFormat == null && fDateFormatKey == null){
      DateConverter dateConverter = BuildImpl.forDateConverter();
      result = dateConverter.formatEyeFriendly(fDate, locale, timeZone);
    }
    else if(fDateFormat != null && fDateFormatKey == null){
      adjustForTimeZone(fDateFormat, timeZone);
      result = fDateFormat.format(fDate);
    }
View Full Code Here

Examples of hirondelle.web4j.request.DateConverter

  private String formatDateTime(){
    String result = "";
    Locale locale = getLocale();
    if(fFormat == null && fFormatKey == null){
      DateConverter dateConverter = BuildImpl.forDateConverter();
      result = dateConverter.formatEyeFriendlyDateTime(fDateTime, locale);
    }
    else if(fFormat != null && fFormatKey == null){
      result = fDateTime.format(fFormat, getLocale());
    }
    else if(fFormat == null && fFormatKey != null){
View Full Code Here

Examples of jodd.typeconverter.impl.DateConverter

    register(BigDecimal.class, new BigDecimalConverter());
    register(BigInteger.class, new BigIntegerConverter());
    register(BigDecimal[].class, new ArrayConverter<BigDecimal>(this, BigDecimal.class));
    register(BigInteger[].class, new ArrayConverter<BigInteger>(this, BigInteger.class));

    register(java.util.Date.class, new DateConverter());
    register(java.sql.Date.class, new SqlDateConverter());
    register(Time.class, new SqlTimeConverter());
    register(Timestamp.class, new SqlTimestampConverter());
    register(Calendar.class, new CalendarConverter());
    register(GregorianCalendar.class, new CalendarConverter());
View Full Code Here

Examples of joptsimple.util.DateConverter

        monthDayYear = new SimpleDateFormat( "MM/dd/yyyy" );
    }

    @Test( expected = NullPointerException.class )
    public void rejectsNullDateFormatter() {
        new DateConverter( null );
    }
View Full Code Here

Examples of net.buffalo.protocal.converters.basic.DateConverter

    BooleanConverter booleanConverter = new BooleanConverter();
    DoubleConverter doubleConverter = new DoubleConverter();
    IntegerConverter integerConverter = new IntegerConverter();
    LongConverter longConverter = new LongConverter();
    StringConverter stringConverter = new StringConverter();
    DateConverter dateConverter = new DateConverter();
    CollectionConverter collectionConverter = new CollectionConverter();
    MapConverter mapConverter = new MapConverter();
    ArrayConverter arrayConverter = new ArrayConverter();
    SqlDateConverter sqlDateConverter = new SqlDateConverter();
    BigNumberConverter bigNumberConverter = new BigNumberConverter();
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.