I'm using the p-columnFilter type="date" to filter date in my table, and i'm not being able to change the date format of the selected date on the calendar (the default format is mm/dd/yy and i want to change to dd/mm/yy)
I know that p-columnFilter uses the p-calendar component that has a dateFormat input that works to change the date format, but the p-columnFilter doesn't pass down the dateFormat input to the p-calendar.
Can anybody help ? Thanks
p-columnFilter doesn't have a dateFormat @input - is this a bug ? Or what's the workaround to change date format?
-
- Posts: 3
- Joined: 21 Jan 2021, 18:11
About the calendar dropdown in my case it is working from the start, it was transparent by default but i've changed the css to make the background appear
Code: Select all
<th>
<div class="p-d-flex p-jc-between p-ai-center">
<p-columnFilter type="date" field="smdata" display="menu">
</p-columnFilter>
</div>
</th>
Thanks for the answer. In my case I want to work with seperate filter row (display="row"). When I change it to "menu" everything except of the date format works.
Code: Select all
<th>
<p-columnFilter type="date" field="deliveryDate"></p-columnFilter>
</th>
Hey, I'm not PrimeNG. I used the stackblitz as follows:
https://stackblitz.com/edit/primeng-tab ... onent.html
I changed the column to display as follows (sortable):
The filter worked but, the display of the calendar control was not consistent with the column data. The appropriate place would be to set locale date format:
https://www.primefaces.org/primeng/showcase/#/i18n
but, I have not figured out how to do that (bummer). See Global locale configuration for calendar component #9387: https://github.com/primefaces/primeng/pull/9387
Phil
https://stackblitz.com/edit/primeng-tab ... onent.html
I changed the column to display as follows (sortable):
Code: Select all
<td>
{{customer.date | date: 'yyyy-MM-dd'}}
</td>
https://www.primefaces.org/primeng/showcase/#/i18n
but, I have not figured out how to do that (bummer). See Global locale configuration for calendar component #9387: https://github.com/primefaces/primeng/pull/9387
Phil
-
- Information
-
Who is online
Users browsing this forum: No registered users and 15 guests