Examples of DateConverter


Examples of br.com.flexait.nfse.converter.DateConverter

    infDeclaracaoPrestacaoServico.setCompetencia(competencia);
    return this;
  }

  private String convertDate(Calendar date) {
    return new DateConverter().toString(date);
  }
View Full Code Here

Examples of com.nearinfinity.hbase.dsl.types.DateConverter

    registerType(new DoubleConverter());
    registerType(new BooleanConverter());
    registerType(new FloatConverter());
    registerType(new LongConverter());
    registerType(new ShortConverter());
    registerType(new DateConverter());
    registerType(new ByteArrayConverter());
    return this;
  }
View Full Code Here

Examples of com.ponysdk.ui.server.form2.dataconverter.DateConverter

public class DateBoxFormField extends FormField<Date> {

    private final PDateBox dateBox;

    public DateBoxFormField() {
        this(new PDateBox(), new DateConverter());
    }
View Full Code Here

Examples of com.salesforce.dataloader.dyna.DateConverter

        }
        if(paramValue instanceof Date) {
            return ((Date)paramValue).getTime();
        }
        else if(paramValue instanceof String) {
            Calendar cal = (Calendar)new DateConverter(tz).convert(java.util.Calendar.class, paramValue);
            return cal.getTimeInMillis();
        } else {
            throw new IllegalArgumentException(Messages.getFormattedString("DatabaseDAO.errorParamMappingType", paramValue.getClass().getName()));
        }
    }
View Full Code Here

Examples of com.salesforce.dataloader.dyna.DateConverter

        final int targetDate = 14;
        final String dateField = "CustomDateField__c";

        TimeZone TZ = TimeZone.getTimeZone("GMT");

        DateConverter converter = new DateConverter(TZ, false);
        //find the csv file
        Map<String, String> argumentMap = getTestConfig(OperationInfo.insert,
                getTestDataDir() + "/timeZoneFormatTesting.csv", false);

        //insert into the account on the custom fields specified
        SObject[] returnedAccounts = retrieveAccounts(runProcess(argumentMap, numberOfRows), dateField);


        for (SObject acct : returnedAccounts) {

            String dateString = (String)acct.getField(dateField);
            Calendar calFromString = (Calendar) converter.convert(null, dateString);

            assertEquals("Day field does not match", targetDate, calFromString.get(Calendar.DAY_OF_MONTH));
        }
    }
View Full Code Here

Examples of com.salesforce.dataloader.dyna.DateConverter

        assertEquals("Invalid testing configuration", numberOfRows, rowOffset + numFailures + numSuccesses);

        TimeZone TZ = TimeZone.getTimeZone("GMT");

        DateConverter converter = new DateConverter(TZ, false);
        //find the csv file
        Map<String, String> argumentMap = getTestConfig(OperationInfo.insert, getTestDataDir()
                + "/timeZoneFormatTestingWithErrors.csv", false);
        argumentMap.put(Config.LOAD_ROW_TO_START_AT, rowOffset.toString());

        // insert into the account on the custom fields specified
        Controller controller = runProcessWithErrors(argumentMap, numSuccesses, numFailures);

        verifyErrors(controller, "Error converting value to correct data type: Failed to parse date: ");

        SObject[] returnedAccounts = retrieveAccounts(controller, dateField);

        // TODO this verification shouldn't be here necessarily. move it to DateProcessTest
        for (SObject acct : returnedAccounts) {

            String dateString = (String)acct.getField(dateField);

            Calendar.getInstance(TZ);
            Calendar calFromString = (Calendar)converter.convert(null, dateString);

            assertEquals("Day field does not match", targetDate, calFromString.get(Calendar.DAY_OF_MONTH));
        }
    }
View Full Code Here

Examples of com.thoughtworks.xstream.converters.basic.DateConverter

public class DateConversionTest extends TestCase {
    /**
     * Put it under a high-concurrency to make sure nothing bad happens.
     */
    public void test1() throws Exception {
        final DateConverter dc =new DateConverter();
        ExecutorService es = Executors.newFixedThreadPool(10);

        List<Future> futures = new ArrayList<Future>();
        for(int i=0;i<10;i++) {
            futures.add(es.submit(new Callable<Object>() {
                public Object call() throws Exception {
                    for( int i=0; i<10000; i++ )
                        dc.fromString("2008-08-26 15:40:14.568 GMT-03:00");
                    return null;
                }
            }));
        }

View Full Code Here

Examples of cookxml.common.converter.DateConverter

    // Locale
    tagLibrary.setCreator ("locale", HelperCreator.getCreator (LocaleHelper.class));
    tagLibrary.setConverter (Locale.class, LocaleConverter.getInstance ());
    // Date
    tagLibrary.setCreator ("date", HelperCreator.getCreator (DateHelper.class));
    tagLibrary.setConverter (Date.class, new DateConverter ());
    // URL
    tagLibrary.setCreator ("url", HelperCreator.getCreator (URLHelper.class));
    tagLibrary.setConverter (URL.class, URLConverter.getInstance ());
    // Object array
    tagLibrary.setCreator ("array", new ArrayCreator ());
View Full Code Here

Examples of fitnesse.slim.converters.DateConverter

  }

  @Test
  public void passOneDate() throws Exception {
    caller.call("testSlim", "oneDate", "5-May-2009");
    assertEquals((Date) new DateConverter().fromString("5-May-2009"), testSlim.getDateArg());
  }
View Full Code Here

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