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

Values changes to DateTime in different CultureInfo ! #88

Closed
piramouns opened this issue Jun 28, 2024 · 6 comments
Closed

Values changes to DateTime in different CultureInfo ! #88

piramouns opened this issue Jun 28, 2024 · 6 comments

Comments

@piramouns
Copy link

piramouns commented Jun 28, 2024

Hi, at first I thank you for this nice component, I appriciate you for sharing it,
When we use a different CultureInfo for example persian ( fa-IR ) , after entring a float value in a cell for example 3.5 , component changes it to 1403/3/5 0:00:00 that's a date in persian calendar, How I can fix it?

My regards

@anmcgrath
Copy link
Owner

Hi @piramouns does the cell have a type set to DateTime? I'm a bit confused as to why this would happen. Can you share an example?

The only thing is it might be parsing the number as a DateTime? This is handled in CellValue.cs

@piramouns
Copy link
Author

Hi,
Thanks for your reply,
you can check it via this sample page ,
https://colifeqm.com/analysis/ge
( the CultureInfo is fa-IR )
I have set cell type as number but it not works,
after loading just enter value 3.5 in a cell,

@anmcgrath
Copy link
Owner

Hey, thanks for the example. I was able to reproduce it in your example and on my machine when setting the CultureInfo to fa-IR.

The sheet is trying to figure out the datatype from the string that you enter ("3.5"), it first tries to parse as a number and then tries to parse the date. I don't know anything about the fa-IR culture info, except that I can see that the culture info NumberFormat.NumberDecimalSeperator is set to "٫". If you change it to "." then it'll parse numbers as you mentioned you wanted to.

@piramouns
Copy link
Author

Hi,
I really appreciate your effort to find the issue,
I try it and back to you ,
hopefully it works for me too,
👍

@anmcgrath
Copy link
Owner

Any updates on this @piramouns ? Have a look at #116 which may also help with restricting the conversion.

@piramouns
Copy link
Author

piramouns commented Nov 3, 2024 via email

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