Skip to content

.csv downloads and datetime/dates #143

Answered by s-cork
billcla asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah - you'll need to use the Accessor Module

Tabulator.modules.add("Accessor")

Then add this to your date/datetime columns

def accessor_date(value, data, type, params, column, row):
    return value.isoformat()

and then in your columns

    {"title": "Today", "field": "some date and time", "headerSort": True, "formatter": "datetime", "formatter_params": 
    {"format": "%d %b %Y, %H:%M:%S"}, "width": 180, "accessor_download": accessor_date},

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@billcla
Comment options

@s-cork
Comment options

Answer selected by billcla
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants