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

feat: Add number format 55 (Kor FMT, yyyy/mm/dd) #811

Open
9ssi7 opened this issue Jul 18, 2024 · 5 comments
Open

feat: Add number format 55 (Kor FMT, yyyy/mm/dd) #811

9ssi7 opened this issue Jul 18, 2024 · 5 comments
Labels

Comments

@9ssi7
Copy link

9ssi7 commented Jul 18, 2024

When I tried to format dates today, I saw that it was only formatted in dd-mm-yy format. After doing some research, I realized that Microsoft had support for this See Office Standarts, but it was omitted in this package.

The standard defines built-in format ID 14: "mm-dd-yy"; 22: "m/d/yy h:mm"; 37: "#,##0 ;(#,##0)"; 38: "#,##0 ;[Red]"; 39: "#,##0.00;(#,##0.00)"; 40: "#,##0.00;[Red]"; 47: "mmss.0"; KOR fmt 55: "yyyy-mm-dd".

Excel defines built-in format ID
14: "m/d/yyyy"
22: "m/d/yyyy h:mm"
37: "#,##0_);(#,##0)"
38: "#,##0_);[Red]"
39: "#,##0.00_);(#,##0.00)"
40: "#,##0.00_);[Red]"
47: "mm:ss.0"
55: "yyyy/mm/dd"

the area that will contain the change in question: https://github.com/tealeg/xlsx/blob/master/xmlStyle.go#L59

Is there a particular reason why it wasn't added?

Copy link

Stale issue message

@tealeg
Copy link
Owner

tealeg commented Sep 17, 2024

I'm pretty sure it was just an oversight. Adding it shouldn't be a hassle.

@benedictjohannes
Copy link
Contributor

@9ssi7 since you have identified the issue and this has triaged, would you help with a PR maybe?

@benedictjohannes
Copy link
Contributor

var builtInNumFmt = map[int]string{

@tealeg @9ssi7 I looked around and found that more default number formats (including format no 55 discussed here) are language specific in exceljs, although number format 55 for zh-cn and zh-tw.

What do you think of language-specific number format? Seems convoluted to me 😖

@tealeg
Copy link
Owner

tealeg commented Nov 7, 2024

@benedictjohannes I think that would require some work to implement correctly.

I've considered for a while that it might be a mistake to have the library set up things like this. In some theoretical rewrite it would be simpler to force all interactions to start from an existing document and have these predefined things just be provided.

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