How format columns as time and keep format in Excel download?

How format columns as time and keep format in Excel download?

jrinconjrincon Posts: 2Questions: 1Answers: 0

Description of problem:
I'm using dataTables 1.10.23 and have a table with some columns that make some calculates time in hh:mm:ss format. The data is showing in right way but when I download to Excel that columns take text format, and can't make math operations.
I was integrate moment.js and datetime.js files but the problem is not resolved yet.
Can somebody send me a tip for find the solution?
Thanks in advance...

JP

Answers

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • jrinconjrincon Posts: 2Questions: 1Answers: 0

    Thanks Colin for your comment. Here is the example. The 3rd column is a field with format hh:mm:ss but when the data is downloaded to Excel, this column takes a text format.

    I hope this help to see the issue.

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    The number format is wrong, see the section on time here, it should be:

                    return moment(data, 'HH:mm:ss').format('H:mm:ss')
    

    Colin

This discussion has been closed.