1

I did use primeng filter on turbo table but its not working with date which is having format "mm/dd/yyyy".

                   *ngIf="col.field === 'abc'"
                   pInputText
                   type="text"
                   (input)="
                     dt.filter(
                       $event.target.value,
                       'abc',
                       'contains'
                     )
                   "
                   class="p-column-filter"
                 />

but it only works with number if I type in text box if I am entering "/" then it doesnt work.

I need a filter who can show result as per matching data from input and input is "07/02/2019 01:30:00"

its mm/dd/yyyy format

Could anyone help me into this?

Is there another way to solve this issue?

Thanks

Sum
  • 61
  • 1
  • 11

1 Answers1

1

Perhaps, you can use the p-calendar element instead of an input: Calendar. It would be like this:

<p-calendar [ngModel]="value"  dateFormat="dd/mm/yy" showTime="true" hourFormat="12" (ngModelChange)="dateChange($event)">
</p-calendar>

And in your typescript code, you add:

dateChange($event) {
    if ($event) {
      //You call method filter
      dt.filter($event.target.value,'abc','contains')
    }
  }

I hope it helps you. Greetings!

Alba
  • 422
  • 2
  • 9
  • 20
  • thanks... but the requirement is for the input text :) – Sum Oct 07 '20 at 13:35
  • Oh!. I thought you could use it because the calendar component is an input component to select dates. I'm sorry. I hope you find a solution!! Maybe, this link can help you: https://www.primefaces.org/primeng/v8.2.8-lts/#/table/filter – Alba Oct 07 '20 at 14:11
  • actually from server response the date format was different and I was changing the date format in order to show on ui so it works. – Sum Oct 21 '20 at 14:50
  • Fantastic! Congratulations! Greetings and have a good afternoon! And I'm sorry for not being helpful @Sum – Alba Oct 21 '20 at 14:54