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

Date type number format support #1258

Closed
diudiudiuu opened this issue Jun 21, 2022 · 1 comment
Closed

Date type number format support #1258

diudiudiuu opened this issue Jun 21, 2022 · 1 comment

Comments

@diudiudiuu
Copy link

image

如果我选择 以元年形式显示第一年,输出会变成 2022-6-2 而不是 令和4年6月2日
如果我没有选择 以元年形式显示第一年,输出正常

下面是我的代码 以及模板
test.xlsx

package main

import (
	"fmt"

	"github.com/xuri/excelize/v2"
)

func main() {
	f, err := excelize.OpenFile("0_mock.xlsx")
	if err != nil {
		fmt.Println(err)
		return
	}


	// 根据指定路径保存文件
	if err := f.SaveAs("aaaaa.xlsx"); err != nil {
		fmt.Println(err)
	}
}
@diudiudiuu diudiudiuu changed the title 单元格设置日本展示方式,输出有问题 单元格设置日本时间,模板输出后时间显示有问题 Jun 21, 2022
@xuri
Copy link
Member

xuri commented Jun 21, 2022

Thanks for your feedback. This issue is similar with #62, #660, #675, #759, and #1055. The Excelize not support to parse all the number formats of the cell. This feature are working in progress. As the documentation says, if the cell format can be applied to the value of a cell, the applied value will be returned, otherwise the original value will be returned. I will close this and merge it into issue #660 is still discussing this feature.

@xuri xuri changed the title 单元格设置日本时间,模板输出后时间显示有问题 Date type number format support Jun 21, 2022
@xuri xuri closed this as completed Jun 21, 2022
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

2 participants