Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date Formatting #8

Open
DavidKCalnex opened this issue Sep 3, 2019 · 5 comments
Open

Date Formatting #8

DavidKCalnex opened this issue Sep 3, 2019 · 5 comments

Comments

@DavidKCalnex
Copy link

Dates seem to be handled just as strings in this component. Is there any way to at a minimum have the dates formatted.

I have my dates coming back from the server in ISO 8601 format e.g. "2019-08-31T14:36:28.511Z" but I would like to format them in a cleaner way say "August 31st 2019". Is there a way to run an external function on each cell?

@DavidKCalnex DavidKCalnex changed the title Date Date Formatting Sep 3, 2019
@waningflow
Copy link
Owner

You can customize the cell content. Refer to this example

@DavidKCalnex
Copy link
Author

Sorry, I don't see where in that example it shows custom cell content.

@waningflow
Copy link
Owner

You can use like this:

<template slot-scope="scope" slot="actionDate">
       <span>{{parseDateFun(scope.row.date)}}</span>
</template>

And add this to the config:

{ prop: "_action", name: "date", actionName: "actionDate" }

@DavidKCalnex
Copy link
Author

That's great thanks ! but I've noticed that sorting in this mode no longer works on the column. Also adding filtering to the column then shows what looks like Chinese buttons with a filter popup that doesn't work.

@waningflow
Copy link
Owner

When using customized cell it's content may be anything even a picture. Thus it's not possible to use these props like "filterable".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants