-
Notifications
You must be signed in to change notification settings - Fork 2
Sc 374 remove timestamp from daily statistics tables date column and correct sort order #847
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -40,7 +40,9 @@ function OpenXDAIssuesPage(props: { Meter: OpenXDA.Types.Meter }) { | |||||
| const [ascending, setAscending] = React.useState<boolean>(false); | ||||||
|
|
||||||
| const order = React.useCallback((data: SC.OpenXDADailyStatistic[]) => { | ||||||
| return _.orderBy(data, [sortField], [ascending ? 'asc' : 'desc']) | ||||||
| const sortedData = _.sortBy(data, [(e) => { return sortField == 'Date' ? moment(e['Date']) : e[sortField] }]) | ||||||
| if (ascending) return sortedData | ||||||
| return sortedData.reverse() | ||||||
| }, [sortField, ascending]); | ||||||
|
|
||||||
| React.useEffect(() => { | ||||||
|
|
@@ -52,7 +54,7 @@ function OpenXDAIssuesPage(props: { Meter: OpenXDA.Types.Meter }) { | |||||
| return () => { | ||||||
| if (handle.abort != undefined) handle.abort(); | ||||||
| } | ||||||
| }, [props.Meter.AssetKey]); | ||||||
| }, [props.Meter.AssetKey, ascending, sortField]); | ||||||
|
||||||
| }, [props.Meter.AssetKey, ascending, sortField]); | |
| }, [props.Meter.AssetKey]); |
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.
Comment is valid Solution does not align with the rest of the codebase.
Uh oh!
There was an error while loading. Please reload this page.