-
Notifications
You must be signed in to change notification settings - Fork 132
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 Features doc for new Time settings #3142
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Preview & Load | ||
|
||
The video below shows how you can preview and | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
--- | ||
sidebar_position: 4 | ||
--- | ||
|
||
# Features | ||
|
||
Learn how to get the most from Zui features. Topics described here include: | ||
|
||
* [Packet Captures](Packet-Captures.md) | ||
* [Preview and load data](Preview-Load.md) | ||
* [Time Display](Time-Display.md) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Time Display | ||
|
||
By default, Zui displays Zed `time` values in the Table, Inspector, | ||
and Detail views using [ZSON format](https://zed.brimdata.io/docs/formats/zson#23-primitive-values). | ||
This is an [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) | ||
date/time string in nanosecond precision ending in `Z` to indicate | ||
[UTC](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), e.g., | ||
`2024-08-14T19:12:51.123456789Z`. | ||
|
||
Starting with Zui release v1.18.0, two different options in Zui **Settings** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I put in the forward-looking reference to the next Zui release so that way I can merge this right away and ping people on community Slack and/or the person that opened brimdata/brimcap#352 to get early feedback. |
||
may be used to change the presentation of time values. | ||
|
||
![Settings - Time](../media/Settings-Time.png) | ||
|
||
1. If the **Time Zone** setting is changed from its default **UTC** while the | ||
**Time Format** setting remains at its empty default, `time` values will be | ||
rendered instead in an RFC 3339 format with a numeric offset, e.g., | ||
`2024-08-14T12:12:51.123-07:00` for setting `US/Pacific`. This format can be | ||
represented using [strftime directives](https://github.com/samsonjs/strftime?tab=readme-ov-file#supported-specifiers) | ||
as `%Y-%m-%dT%H:%M:%S.%L%:z`. Note that this format is acceptable as a | ||
literal `time` value in a Zed program, e.g., assuming data containing a field | ||
`ts` of the `time` type, the [search expression](https://zed.brimdata.io/docs/language/search-expressions) | ||
`ts > 2024-08-14T12:12:51.123-07:00` is syntactically valid. | ||
|
||
2. If the **Time Format** setting is changed from its empty default, any | ||
[strftime directives](https://github.com/samsonjs/strftime?tab=readme-ov-file#supported-specifiers) | ||
in the setting are used to format time values. For instance the setting | ||
`%m/%d/%Y %Z` would produce the displayed value `08/14/2024 Pacific Daylight Time`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we should use the capital %Z in this example since it's broken in the strftime library. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jameskerr: Yeah, you'd mentioned offline how you perceived For instance, I start by importing this file
Here's how it looks with the default ZSON formatting: Here's how it changes if I change just the Time Zone to "US/Pacific" and let the the default Now I go back into Settings and also change Time Format to So, that all seems correct to me, but maybe there's something else I'm missing. 😄 If it'd be easier to hash this out interactively on a Zoom just ping me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jameskerr and I spoke offline and I understand what's broken now. Here's some detail for the record. I wasn't triggering the problem in my last comment above because I picked "US/Pacific" which happens to also be my local time zone. However, if I pick a different time zone like "US/Eastern", we see: That shows the hour has been correctly adjusted to For now I'll rework the example to avoid showing |
||
|
||
:::tip Note | ||
These settings do not currently change the times shown on the X axis of the | ||
stacked bar chart that appears above query results. Addressing this is tracked | ||
in issue [zui/3141](https://github.com/brimdata/zui/issues/3141). Please add a | ||
comment to the issue if you find it affects your use of Zui. | ||
::: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ export function runConfigurations() { | |
properties: { | ||
timeZone: { | ||
name: "timeZone", | ||
label: "Timezone", | ||
label: "Time Zone", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I was assembling the screenshot, I realized the two-word "Time Zone" seems to be the more common use in places like RFC 3339 and ISO 8601, so I've switched to that. |
||
type: "string", | ||
defaultValue: "UTC", | ||
enum: time.getZoneNames(), | ||
|
@@ -50,7 +50,7 @@ export function runConfigurations() { | |
placeholder: "%Y-%m-%dT%H:%M:%S.%L%:z", | ||
helpLink: { | ||
label: "docs", | ||
url: "https://github.com/samsonjs/strftime?tab=readme-ov-file#supported-specifiers", | ||
url: "https://zui.brimdata.io/docs/features/Time-Display", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Chicken/egg. This link will be broken until the PR merges. C'est la vie! |
||
}, | ||
}, | ||
thousandsSeparator: { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dropped these
sidebar_position
directives in all these Features articles since that way they're automatically sorted alphabetically.