Package hirondelle.web4j.request

Examples of hirondelle.web4j.request.DateConverter


    Locale locale = BuildImpl.forLocaleSource().get(getRequestParser().getRequest());
    TimeZone timeZone = BuildImpl.forTimeZoneSource().get(getRequestParser().getRequest());
    fLogger.fine("TimeZone " + timeZone + " Locale " + locale);
    ToppingsEtc toppingsEtc = new ToppingsEtc(timeZone, locale);
   
    DateConverter converter = BuildImpl.forDateConverter();
    for(Date date : toppingsEtc.getBirthDate()){
      fLogger.fine("Birth Date: " + converter.formatEyeFriendly(date, locale, timeZone) );
    }
   
    addToRequest(ITEM_FOR_EDIT, toppingsEtc);
  }
View Full Code Here


      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

      }
    }
   
    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

      }
    }
   
    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

  }
 
 
  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

    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

    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

  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

TOP

Related Classes of hirondelle.web4j.request.DateConverter

Copyright © 2018 www.massapicom. 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.