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

Add time zone to the Device View Column options and sorting options #6544

Open
vgz opened this issue Nov 18, 2024 · 3 comments
Open

Add time zone to the Device View Column options and sorting options #6544

vgz opened this issue Nov 18, 2024 · 3 comments

Comments

@vgz
Copy link

vgz commented Nov 18, 2024

Is your feature request related to a problem? Please describe.
We manage devices across the country and it would be very useful to have the time zone and current local time from the device listed and available as a sort option.

Describe the solution you'd like
Please add an option to show the time zone set on the device as a Device View Column option, with a sub option to show the current local time. Please also allow sorting the devices by timezone, preferably as a secondary sort option, so that we can sort by group with timezone as a sub sort under the groups.

Describe alternatives you've considered
We've considered trying to add the time zone at the beginning of the name, but with over a thousand devices this would be extremely time consuming and with some devices moving between time zones it is not a completely foolproof solution.

@si458
Copy link
Collaborator

si458 commented Nov 18, 2024

The columns view only shows static data, and when data gets pushed from the remote device to meshcentral, it's then pushed to your web browser if u have it open

It would be difficult to show the current devices times because that changes every second, and we would have to push the data every second, so that seems unproductive, unless we was pushing the current time every minute maybe?

Now we could add the timezone as a column as that should never change, but we can get that on startup, and it's set ready for u and doesn't change unless day lights savings haha

Also, can u draw an example of what u wanted?
(Sounds daft, but I work best with pictures 😂)

@vgz
Copy link
Author

vgz commented Nov 18, 2024

Thanks for the prompt response.

The basic idea was to have another column that showed the timezone abreviation, reflecting the current state of daylight savings time (EST/EDT).

As for the option of showing the time, I was thinking more along the lines of an estimated local time. The idea would be to take the time and timezone from your browser and adjust it by the offset of the time zone the machine is set to. That way it doesn't have to continuously read the exact time from the remote system. Since this would be an estimate, there would be no reason to update it more than once a minute.

You can use const tz = Intl.DateTimeFormat().resolvedOptions().timeZone; to get the timezone from the user's browser. This does not include the offset, so it would require using the name with a lookup table, but this would allow for showing the estimated time for the area the device is located without wasting bandwidth.

The other part should probably be a separate feature request, but essentially I was thinking of having a second sort menu so you can do 2 sorts at once. Such as group/timezone, group/last_seen, last_seen/timezone, etc.

I'll try to mock up a UI image later if I have some time to do so.

@si458
Copy link
Collaborator

si458 commented Nov 18, 2024

Ah, right. I understand u and a brilliant idea!

We get timezone on startup (and periodically, I think every 5 mins), meshcentral then knows about the timezone to show in 1 column.

Then, in another column, we can calculate the time based on users' browser time/date but use the timezone from the remote device!

Got u!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants