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

Is it possible to set the formatting of a column as date? #48

Open
GishaJamesB opened this issue Aug 31, 2017 · 3 comments
Open

Is it possible to set the formatting of a column as date? #48

GishaJamesB opened this issue Aug 31, 2017 · 3 comments
Labels

Comments

@GishaJamesB
Copy link

I saw cell formatting is possible. But is it possible to format a column

@Fabi755
Copy link
Collaborator

Fabi755 commented Aug 31, 2017

Yes that is possible.
For some examples, see the example.exs.

For format your column as date use the :datetime, :yyyymmdd or :num_format option.

Sheet.set_cell(sheet, "A2", {{2015, 11, 30}, {21, 20, 38}}, datetime: true)
Sheet.set_cell(sheet, "A4", 1448882362, yyyymmdd: true)
Sheet.set_cell(sheet, "F1", {:formula, "NOW()"}, num_format: "yyyy-mm-dd hh:MM:ss")

@GishaJamesB
Copy link
Author

That is formatting cell one by one. Is it possible to format the column, something like
Sheet.set_column(sheet, "A", {{2015, 11, 30}, {21, 20, 38}}, datetime: true), which formats the column A as date

@ryanhart2
Copy link
Contributor

Currently the only information able to be stored for columns appears to be column_width. Instead of storing an integer for col_width, I think that a map should be stored %{width: integer} for each column. Additional column information could then be included e.g. fill, number format etc. The xml generation functions would need to be updated to interpret the additional fields and output the correct xml. I intend to work on this.

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

No branches or pull requests

3 participants