Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Listgrid date range filter validate wrong format for TOEUROPEANSHORTDATE

    SmartClient Version: v8.3p_2013-03-11/LGPL Development Only (built 2013-03-11)
    Firefox 15.0.1

    I'm trying to use Listgrid date range filter on development mode with the locale "pt_BR" and display format TOEUROPEANSHORTDATE. The calendar is displayed ok, when i select the date the displayed format is ok too, but when i click on ok button a validation message is showed saying the date is not valid. If i type the date on the format "YYYY-MM-DD" it works, but i need the date on "DD/MM/YYYY" format.

    I tryed to set the setDateFormatter to TOEUROPEANSHORTDATE on FormItem, and pass it as setFilterEditorProperties, but not work. There is my code and a print screen in attachment.

    Code:
    final ListGridField dataVencimento = new ListGridField("data_vencimento", "Vencimento"); 
    dataVencimento.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATE);
    
    final DateRangeItem rangeItem = new DateRangeItem();
    rangeItem.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATE);
    dataVencimento.setFilterEditorProperties(rangeItem);
    Attached Files

    #2
    See DateUtil docs. Formatter and inputFormat must match.

    Comment


      #3
      It works, but my default value not.

      I set up the input format and it works.
      Code:
      DateUtil.setDateInputFormat("DMY");
      DateUtil.setShortDateDisplayFormatter(DateUtil.TOEUROPEANSHORTDATE);
      But when i tried to set up a default value for list grid filter the value is shown ok but when i clear the value and filter the list grid the default value it is not cleaned.

      Any sugestions?

      Code:
      Date dataHoje = new Date(System.currentTimeMillis());
      Date dataInicial = new Date(dataHoje.getYear(), dataHoje.getMonth(), 1);
      Date dataFinal = new Date(dataHoje.getYear(), dataHoje.getMonth() + 1, 1);
      		
      CalendarUtil.addDaysToDate(dataFinal, -1);
      		
      DateRange dateRange = new DateRange();  
      dateRange.setStartDate(dataInicial);
      dateRange.setEndDate(dataFinal);
      		
      DateRangeItem dtRangeItem = new DateRangeItem();
      dtRangeItem.setValue(dateRange);
      
      final ListGridField dataVencimento = new ListGridField("data_vencimento", "Vencimento"); 		
      dataVencimento.setAlign(Alignment.CENTER);
      dataVencimento.setFilterEditorProperties(dtRangeItem);

      Comment

      Working...
      X