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

how to read date as formatted date using usedRange() ? #357

Open
prashantnirgun opened this issue Jul 24, 2023 · 0 comments
Open

how to read date as formatted date using usedRange() ? #357

prashantnirgun opened this issue Jul 24, 2023 · 0 comments

Comments

@prashantnirgun
Copy link

I am reading data using range code is as follows. Column E contain date in dd/mm/yyyy format, but even if I specified style for that column it still read it as number. I think there should be option to set style and read range as formatted dates

const file = '/home/prashant/www/wa/wppconnect-server/uploads/excels/sample.xlsx';
const workbook = await reader.fromFileAsync(file);
const sheet = workbook.sheet(0);
sheet.column('E').style('numberFormat', 'dd/mm/yyyy');
const values = sheet.usedRange().value();
console.log(values);

it return date as

[
  [ "Name", "Date" ],
  [ "SaXXX",  29445 ],
  [ "Prashant", 27120 ],
  [ "Shreeyash", 33105  ]
]
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

1 participant