Examples of DateConverter


Examples of org.apache.wicket.util.convert.converter.DateConverter

    set(Integer.class, IntegerConverter.INSTANCE);
    set(Long.TYPE, LongConverter.INSTANCE);
    set(Long.class, LongConverter.INSTANCE);
    set(Short.TYPE, ShortConverter.INSTANCE);
    set(Short.class, ShortConverter.INSTANCE);
    set(Date.class, new DateConverter());
    set(java.sql.Date.class, new SqlDateConverter());
    set(java.sql.Time.class, new SqlTimeConverter());
    set(java.sql.Timestamp.class, new SqlTimestampConverter());
    set(BigDecimal.class, new BigDecimalConverter());
  }
View Full Code Here

Examples of org.apache.wicket.util.convert.converter.DateConverter

  /**
   * Test date locale conversions.
   */
  public void testDateConverter()
  {
    DateConverter converter = new DateConverter();

    Calendar cal = Calendar.getInstance(DUTCH_LOCALE);
    cal.clear();
    cal.set(2002, Calendar.OCTOBER, 24);
    Date date = cal.getTime();

    assertEquals("24-10-02", converter.convertToString(date, DUTCH_LOCALE));
    assertEquals(date, converter.convertToObject("24-10-02", DUTCH_LOCALE));

    assertEquals("10/24/02", converter.convertToString(date, Locale.US));
    assertEquals(date, converter.convertToObject("10/24/02", Locale.US));

    try
    {
      converter.convertToObject("whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // this is correct
    }
    try
    {
      converter.convertToObject("10/24/02whatever", Locale.US);
      fail("Conversion should have thrown an exception");
    }
    catch (ConversionException e)
    {
      // this is correct
View Full Code Here

Examples of org.apache.wicket.util.convert.converters.DateConverter

  protected DateConverter getDateConverter()
  {
    if (dateConverter == null)
    {
      dateConverter = new DateConverter();
    }

    return dateConverter;
  }
View Full Code Here

Examples of org.apache.wicket.util.convert.converters.DateConverter

            settings.setStyle( settings.newStyleWinter() );
            settings.setIcon( new ResourceReference(this.getClass(), "calendar.gif") );
   
            DatePicker picker = new PopupDatePicker("datePicker", dateField, settings);
            // This sucks! It expects a DateConverter. I've got my own.
            DateConverter dateConverter = new DateConverter() {
                private static final long serialVersionUID = 1L;
                @Override
                public DateFormat getDateFormat(Locale locale)
                {
                    SimpleDateFormat dateFmt = new SimpleDateFormat(fmt);
View Full Code Here

Examples of org.apache.wicket.util.convert.converters.DateConverter

  protected DateConverter getDateConverter()
  {
    if (dateConverter == null)
    {
      dateConverter = new DateConverter();
    }

    return dateConverter;
  }
View Full Code Here

Examples of org.apache.wicket.util.convert.converters.DateConverter

    set(Integer.class, IntegerConverter.INSTANCE);
    set(Long.TYPE, LongConverter.INSTANCE);
    set(Long.class, LongConverter.INSTANCE);
    set(Short.TYPE, ShortConverter.INSTANCE);
    set(Short.class, ShortConverter.INSTANCE);
    set(Date.class, new DateConverter());
    set(java.sql.Date.class, new SqlDateConverter());
    set(java.sql.Time.class, new SqlTimeConverter());
    set(java.sql.Timestamp.class, new SqlTimestampConverter());
    set(BigDecimal.class, new BigDecimalConverter());
  }
View Full Code Here

Examples of org.apache.wicket.util.convert.converters.DateConverter

   */
  public DateTextField(String id, IModel<Date> model, String datePattern)
  {
    super(id, model, Date.class);
    this.datePattern = datePattern;
    converter = new DateConverter()
    {
      private static final long serialVersionUID = 1L;

      /**
       * @see org.apache.wicket.util.convert.converters.DateConverter#getDateFormat(java.util.Locale)
View Full Code Here

Examples of org.bifrost.xmlio.config.DateConverter

  {
    // Configure date/timestamp formats
    XmlIOConfig config = XmlIOConfig.getInstance();
    // Override the default date and timestamp converters to use a different
    // format.
    DateConverter dconv = new DateConverter("yyyy-MM-dd");
    config.addConverter(dconv);
    TimestampConverter tconv = new TimestampConverter("yyyy-MM-dd HH:mm");
    config.addConverter(tconv);
   
    List plist = new LinkedList();
    PropertyMap pmap = new PropertyMap("created");
    plist.add(pmap);
    pmap = new PropertyMap("startDate");
    plist.add(pmap);
    pmap = new PropertyMap("startTime");
    dconv = new DateConverter("HH:mm:ss");
    pmap.setConverter(dconv);
    plist.add(pmap);
    pmap = new PropertyMap("endTime");
    pmap.setConverter(dconv);
    plist.add(pmap);
View Full Code Here

Examples of org.camunda.bpm.engine.rest.dto.converter.DateConverter

    if (suspended != null && suspended) {
      query.suspended();
    }

    if (dueDates != null) {
      DateConverter dateConverter = new DateConverter();
      dateConverter.setObjectMapper(objectMapper);

      for (ConditionQueryParameterDto conditionQueryParam : dueDates) {
        String op = conditionQueryParam.getOperator();
        Date dueDate = null;

        try {
          dueDate = dateConverter.convertQueryParameterToType((String) conditionQueryParam.getValue());
        } catch (RestException e) {
          throw new InvalidRequestException(e.getStatus(), e, "Invalid due date format: " + e.getMessage());
        }

        if (op.equals(ConditionQueryParameterDto.GREATER_THAN_OPERATOR_NAME)) {
View Full Code Here

Examples of org.codehaus.plexus.component.configurator.converters.basic.DateConverter

        registerDefaultConverter( new StringBufferConverter() );

        registerDefaultConverter( new StringConverter() );

        registerDefaultConverter( new DateConverter() );

        registerDefaultConverter( new FileConverter() );

        registerDefaultConverter( new UrlConverter() );
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.