How do I use Date Pipe if setting up columns via DataTableOptions? #1718
Unanswered
softsolutionsau
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Team,
I've been using the documentation to understand how to set up column definitions. The examples given (currency and upper case) are working well for me, but I also have a column I need to show in short-date format.
columns = [
{ title: 'Id', data: 'id'},
{ title: 'Amount', data: 'actualAmount' , ngPipeInstance: this.pipeCurrencyInstnace, ngPipeArgs: ['CAD','code']},
{ title: 'First Name', data: 'firstName'},
{ title: 'Last Name', data: 'lastName', ngPipeInstance: this.pipeUppercaseInstance},
{ title: 'Email', data: 'email'},
{ title: 'Phone', data: 'phoneNumber'},
{ title: 'Registered On', data: 'registered' , ngPipeInstnace: this.pipeDateTimeInstance, ngPipeArgs: ['shortDate']},
{ title: 'Enable Auto-Invoicing', data: 'autoInvoice'}
];
Amount and Last Name render as expected, the Registered On does not. sample data:
"data": [
{
"id": 507,
"actualAmount": 37.00
"firstName": "Aaron",
"lastName": "Sachez",
"email": "[email protected]",
"phoneNumber": "0402555681",
"registered": "2022-02-04T10:38:19.3742652",
"autoInvoice": false
},
{
"id": 544,
"actualAmount": 65.20
"firstName": "Abbirev",
"lastName": "Murphy",
"email": "[email protected]",
"phoneNumber": "0431555994",
"registered": "2022-03-16T11:32:58.6275634",
"autoInvoice": false
},
{
"id": 332,
"actualAmount": 102.00
"firstName": "Adaling",
"lastName": "Laug",
"email": "[email protected]",
"phoneNumber": "0450 555 388",
"registered": "2021-09-02T23:41:46.7197359",
"autoInvoice": false
}
]
Does anyone have an example of how to set up date pipes?
Thanks!
Shai
Beta Was this translation helpful? Give feedback.
All reactions