Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Format date on export XLSX #880

Open
rsereir opened this issue Mar 24, 2022 · 0 comments
Open

Format date on export XLSX #880

rsereir opened this issue Mar 24, 2022 · 0 comments

Comments

@rsereir
Copy link

rsereir commented Mar 24, 2022

Hello,

I am looking for format date cell on export XLSX but i have ### in my cell ( with a good date formatting: filters and cell content are ok, it's just a wrong cell text )

I generate my cell like this:

public function formatDate(\DateTime $date)
    {
        $format = $this->localeFormat->getYearMonthDayFormat();

        return WriterEntityFactory::createCell(Date::PHPToExcel($date), (new StyleBuilder())->setFormat('dd/mm/YYYY')->build());
    }

I also tried this date format: m/d/yy h:mm and it's didn't working.

Thanks

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

No branches or pull requests

1 participant