Control for choosing an Offset; additional zone filters

Skip to first unread message

Zev Spitz

Jul 13, 2020, 9:46:28 PM7/13/20
to Noda Time
As part of the VS debug visualizer I've written for DateTime, I've included a UI to select one or more zones (from either the TZDB or BCL providers).
I've implemented a simple text filter, but I think it would be useful to filter the available zones by some other criteria.
Given that the only information available via NodaTime's DateTimeZone class is the minimum and maximum offset, I was thinking to allow the user to select a UTC offset, and displaying only those zones which contain the selected offset. But I can't quite choose the right UI control for selecting an Offset. A simple textbox whose string would be parsed using OffsetPattern means the user can provide invalid inputs, which is something I would like to avoid.
What UI is appropriate for selecting an Offset?

Additionally, what other filters would it be appropriate to add?

Thanks in advance,
Zev Spitz

Jon Skeet

Jul 14, 2020, 2:35:18 AM7/14/20
to Noda Time
I don't think there's any "right" answer here, but I'd probably suggest using "right now" to get the ZoneInterval, and then offer users the choice of either entering the standard offset (so I'd always put in UTC+0 for the UK) or the wall offset (so in the winter I'd put in UTC+0, and in the summer I'd put in UTC+1). I can see those both being useful at different times.

In terms of how the offset is specified, I suspect that actually a textbox is the simplest approach - just indicate to the user when the input is invalid. I'd expect it to cope with:


If it can do all of those, you're probably fine.


You received this message because you are subscribed to the Google Groups "Noda Time" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages