Skip to content

Commit

Permalink
Add finer control over interval range in timetracking view (#4604)
Browse files Browse the repository at this point in the history
* add hour, minute and seconds intervall controll to timetracking

* add changelog entry

* go back to always refetching timetracking data on change

* remove option to select seconds in time tracking view
  • Loading branch information
MichaelBuessemeyer authored May 14, 2020
1 parent 362a77a commit f6b5d44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released

### Added

- Added the possibility to select hour, minute and second of the time range in the timetracking view. [#4604](https://github.com/scalableminds/webknossos/pull/4604)
- Volume tracing data is now saved with lz4 compression, reducing I/O load and required disk space. [#4602](https://github.com/scalableminds/webknossos/pull/4602)

### Changed
Expand Down
8 changes: 5 additions & 3 deletions frontend/javascripts/admin/time/time_line_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ class TimeLineView extends React.PureComponent<Props, State> {
return;
}

// for same day use start and end timestamps
const dateRange = dates[0].isSame(dates[1], "day")
? [dates[0].startOf("day"), dates[1].endOf("day")]
// Force an interval of at least one minute.
const dateRange = dates[0].isSame(dates[1], "minute")
? [dates[0].startOf("day"), dates[0].add(1, "minute")]
: dates;

await this.setState({ dateRange });
Expand Down Expand Up @@ -300,6 +300,8 @@ class TimeLineView extends React.PureComponent<Props, State> {
</FormItem>
<FormItem {...formItemLayout} label="Date">
<RangePicker
showTime={{ format: "HH:mm" }}
format="YYYY-MM-DD HH:mm"
allowClear={false}
style={{ width: "100%" }}
value={dateRange}
Expand Down

0 comments on commit f6b5d44

Please sign in to comment.