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

Clocks: sort in order specified #896

Closed
OJFord opened this issue May 17, 2020 · 1 comment · Fixed by #981
Closed

Clocks: sort in order specified #896

OJFord opened this issue May 17, 2020 · 1 comment · Fixed by #981
Labels
💥 feature "Good luck, you're gonna need it."

Comments

@OJFord
Copy link

OJFord commented May 17, 2020

What should it do?

clocks:
  locations:
    London: 'Europe/London'
    GMT: 'GMT'

Currently (with London on BST) there would be no way to get those displayed in the order specified. sort: alphabetical and sort: chronological will both put GMT first.

While asc/descending sort might be nice, what I'm actually requesting is sort: as-written, and hoping that that order is preserved by the yaml parser you're using (since it's not an array, I think the spec allows it not to be).

I'd go so far as to say 'as-written' sorting would be the most obvious default, too.

@OJFord OJFord changed the title Clocks sort in order specified Clocks: sort in order specified May 17, 2020
@senorprogrammer senorprogrammer added the 💥 feature "Good luck, you're gonna need it." label May 18, 2020
@senorprogrammer
Copy link
Collaborator

Clocks are listed as a keyed map. In the config file they have an order, but when serialized from JSON, no information about that ordering is preserved (Go maps do not have an order). To achieve this a new config data structure would need to used. If you do decide to tackle this, any changes need to be backwards-compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥 feature "Good luck, you're gonna need it."
Development

Successfully merging a pull request may close this issue.

2 participants