-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
fronted uses the client's timezone #68
Comments
Hi zavndw |
Hello. Requires a little frontend revision. Now he takes the timezone from the browser, you need to make this behavior customization. If I understand correctly, then in this place you need to make changes https://github.com/mbolli/nfsen-ng/blob/master/frontend/js/nfsen-ng.js#L672 |
fixed,THX |
what would be your preference: to take the timezone from the server or to specify it in the config? or both? |
select the time zone on the web. Default server zone |
Got the same problem but didn't quite understand which variable or value I should change.
Is this the correct method I should edit? /**
* reads options from api_graph_options, performs a request on the API
* and tries to display the received data in the dygraph.
*/
function updateGraph() |
I believe here is where I should edit the $.each(data.data, function (datetime, series) {
var position = [new Date(datetime * 1000)];
// add all serie values to position array
$.each(series, function (y, val) {
position.push(val);
});
// push position array to dygraph data
if (dygraph_did_zoom !== true) {
dygraph_data.push(position);
} else {
// when zoomed in, insert position array at the start index of replacement data
dygraph_data.splice(index_to_insert, 0, position);
index_to_insert++; // increase index, or data will get inserted backwards
}
}); I changed and then Am I missing something here? |
Oopsie, the correct should be: var position = [new Date((datetime * 1000) + (3 * 60 * 60 * 1000))]; since my TZ is UTC-3 Solved. |
@FontouraAbreu can you test #90 or apply these changes 8334fc9 to see if the automatic server timezone detection works? |
Sure thing! I will start redoing everything from scratch by next week's end and will use the Personally, I prefer a '.conf' file to set these kind of things as said in #17. But I'll surely give preference to an updated |
Testing this one now, but just to make sure: This server you talked about, is it the host machine where the application is running or the apache server? I'm using apache2 so If this is the case for the "server" mentioned, I've already changed it to my current timezone(UTC-3) and restarted the apache and the nfsen-ng service. Graph date is being displayed correctly: As my last |
I've just noticed the dates are wrong. For some reason its showing that this data is from 2022, not sure why this is happening My profiles-data directory structure: root@nfsen-ng:~# tree -d /var/nfdump/profiles-data/live/source/
/var/nfdump/profiles-data/live/source/
└── 2024
└── 02
├── 21
├── 22
├── 23
├── 24
├── 25
└── 26
9 directories My machine current date: root@nfsen-ng:~# date
Mon Feb 26 13:28:47 -03 2024 |
very weird. when using nfdump does it show the correct dates? |
@mbolli - yes it does show the correct date |
@mbolli any hints on why this might be happening? |
@FontouraAbreu are you on v0.3.1? |
perfect! :) |
if the client looks at the server graphs from a different time zone, it is required to set the time shift in the interface
The text was updated successfully, but these errors were encountered: