Time format changes on publish


https://www.nevron.com/Forum/Topic13111.aspx
Print Topic | Close Window

By Mike O'Ceirin - 4 Years Ago
My solution produces a chart with the x-axis being in 24-hour time. That is I have 21:00 22:00 et cetera this works well on my development machine. When I publish to the Web server the times changed to am/pm so that is 9:00 pm 10:00 pm and so on. I surmise the chart is reading it from the computer it is running on. I doubt I can change that so how do I force the NEVRON chart to write 24-hour time? It is ASP.NET using a web form.
I have tried using
dateTimeScale.LabelValueFormatter = new NDateTimeValueFormatter("HH:mm");
but it makes no difference.
By Nevron Support - 4 Years Ago
Hi Mike,

You're correct - the control uses the current machine (server) culture settings for label formatting. To override this behavior you can use:

NDateTimeScaleConfigurator dateTimeScale = new NDateTimeScaleConfigurator();
dateTimeScale.EnableUnitSensitiveFormatting = false;

NDateTimeValueFormatter labelFormatter = new NDateTimeValueFormatter("HH:mm");
labelFormatter.CultureInfo = CultureInfo.InvariantCulture;
dateTimeScale.LabelValueFormatter = labelFormatter;

This will ensure that you always use the same culture settings regardless of the server.
We hope this helps - let us know if you meet any problems or have any questions.
By Mike O'Ceirin - 4 Years Ago
Spot on thank you. I have a lot of time looking at your documentation searching the Internet to find that. Is there a quicker way? Is there a tutorial that goes through step-by-step setting up a chart with all bells and whistles? I have looked for that but have not found it.
By Nevron Support - 4 Years Ago
Hi Mike,

We don't' have a shortened version of the user’s guide, however, we definitely have to put a few words in the docs regarding the current culture formatting. We'll also try to have a chapter dedicated to the general concepts in the chart in the upcoming version (most likely we'll not be able to release a new version in 2020, only service packs, so it will be early 2021). In the meantime, if you have any questions just let us know – we’ll gladly try to help.