Skip to content
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 lookahead padding to the plan time axis #3419

Merged
merged 49 commits into from
Mar 29, 2021
Merged

Add lookahead padding to the plan time axis #3419

merged 49 commits into from
Mar 29, 2021

Conversation

shefalijoshi
Copy link
Contributor

Resolves #3418

  • Add 30 minutes to the plan's time axis
  • Fix start and end properties of the activities JSON to use UTC instead of timestamps

Author Checklist

Changes address original issue? Yes
Unit tests included and/or updated with changes? Yes
Command line build passes? Yes
Changes have been smoke-tested? Yes
Testing instructions included? Yes

add resizing for timeline view plans
// this.viewBounds.end = this.viewBounds.end + (30 * 60 * 1000);
//Add a 30 min padding to the end bounds to look ahead
let endDate = new Date(this.viewBounds.end);
endDate.setMinutes(endDate.getMinutes() + 30);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we were going to add a 50% margin here? I might be misremembering though. A percentage margin is a little more compatible with non-UTC time systems (which we don't need to support right now, but also don't want to close the door to them prematurely).

Also, I don't think setMinutes works like this, it only accepts minutes values between 0-59. So, there is a potential overflow problem here.

Another approach to this might be something like:

let timespan = (this.viewBounds.end - this.viewBounds.start);
let padding = timespan * 0.5;
this.viewBounds.end = timespan + padding;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duh! of course...not sure what I was thinking here.
Hmm I thought we were going to look ahead by a specific duration. I'm fine with a percentage margin too. I'll fix it.

@@ -2,24 +2,24 @@
"ROVER": [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be deleted from our repository.

@akhenry
Copy link
Contributor

akhenry commented Nov 19, 2020

@shefalijoshi Would be good to get this merged

@shefalijoshi shefalijoshi requested a review from akhenry February 1, 2021 17:47
Copy link
Contributor

@akhenry akhenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Checklist

  1. Changes appear to address issue? Y
  2. Appropriate unit tests included? N/A - Change is small enough that it doesn't warrant unit tests
  3. Code style and in-line documentation are appropriate? Y
  4. Commit messages meet standards? Y
  5. Has associated issue been labelled unverified? (only applicable if this PR closes the issue) Y

@akhenry akhenry merged commit b4a87dd into master Mar 29, 2021
@akhenry akhenry deleted the timeviews/plan branch March 29, 2021 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add lookahead time to the plan view
2 participants