Repository navigation
fix(new-webui): Modify all timestamps to UTC timezone. #1000
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
Changes from 11 commits
02c3261
a3d8f53
0ab4068
84c9635
380ed08
d0f2800
ccbecac
0d47fb0
5ef79c9
15c7e04
70a2736
eaf4939
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 |
|---|---|---|
|
|
@@ -32,7 +32,7 @@ const searchResultsTableColumns: NonNullable<TableProps<SearchResult>["columns"] | |
| dataIndex: "timestamp", | ||
| defaultSortOrder: "descend", | ||
| key: "timestamp", | ||
| render: (timestamp: number) => dayjs(timestamp).format(DATETIME_FORMAT_TEMPLATE), | ||
| render: (timestamp: number) => dayjs.utc(timestamp).format(DATETIME_FORMAT_TEMPLATE), | ||
|
Member
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. |
||
| sorter: (a, b) => { | ||
| const timestampDiff = a.timestamp - b.timestamp; | ||
| if (0 !== timestampDiff) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,9 +23,9 @@ const SEARCH_STATE_DEFAULT = Object.freeze({ | |
| searchJobId: null, | ||
| searchResultsMetadata: null, | ||
| searchUiState: SEARCH_UI_STATE.DEFAULT, | ||
| timeRange: TIME_RANGE_OPTION_DAYJS_MAP[DEFAULT_TIME_RANGE], | ||
| timeRange: TIME_RANGE_OPTION_DAYJS_MAP[DEFAULT_TIME_RANGE](), | ||
| timeRangeOption: DEFAULT_TIME_RANGE, | ||
| timelineConfig: computeTimelineConfig(TIME_RANGE_OPTION_DAYJS_MAP[DEFAULT_TIME_RANGE]), | ||
| timelineConfig: computeTimelineConfig(TIME_RANGE_OPTION_DAYJS_MAP[DEFAULT_TIME_RANGE]()), | ||
| }); | ||
|
Comment on lines
+26
to
29
Contributor
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. 🛠️ Refactor suggestion Avoid double evaluation of “now” when initialising default state
- timeRange: TIME_RANGE_OPTION_DAYJS_MAP[DEFAULT_TIME_RANGE](),
- timeRangeOption: DEFAULT_TIME_RANGE,
- timelineConfig: computeTimelineConfig(TIME_RANGE_OPTION_DAYJS_MAP[DEFAULT_TIME_RANGE]()),
+ timeRangeOption: DEFAULT_TIME_RANGE,
+ timeRange: (() => {
+ const range = TIME_RANGE_OPTION_DAYJS_MAP[DEFAULT_TIME_RANGE]();
+ return range;
+ })(),
+ timelineConfig: (() => {
+ const sameRange = TIME_RANGE_OPTION_DAYJS_MAP[DEFAULT_TIME_RANGE]();
+ return computeTimelineConfig(sameRange);
+ })(),Capture the range once and reuse it for consistency.
🤖 Prompt for AI Agents |
||
|
|
||
| interface SearchState { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.