-
Notifications
You must be signed in to change notification settings - Fork 19
Issue 239 stop old due dates #269
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 all commits
2f11ad8
9cc7fb7
ab7b75a
28073c7
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 |
|---|---|---|
|
|
@@ -10,3 +10,4 @@ tmp/ | |
|
|
||
| # css is compiled from scss in /styles | ||
| public/main.css | ||
| package-lock.json | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,17 @@ export const parsePromise = ({ | |
| const { tini, tdue: dueDate, tfin } = promise | ||
|
|
||
| const text = parseText({ text: urtext }) | ||
| const { eventTitle, isAllDay, startDate } = parseSherlock({ text, timezone }) | ||
| let { eventTitle, isAllDay, startDate } = parseSherlock({ text, timezone }) | ||
|
|
||
| if ( moment(startDate).isBefore(moment().subtract(1, 'years')) ) { | ||
| <<<<<<< HEAD | ||
| log.warn('parsePromise rejected, past due date:', startDate) | ||
| startDate = null // clear startDate if more than a year ago | ||
| ======= | ||
| log.debug('Caught and fixed promise with old parsed start date of:', startDate) | ||
|
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. Line 36 exceeds the maximum line length of 80.
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. good idea to log this, we should probably have it as a |
||
| startDate = null; // clear startDate if more than a year ago | ||
|
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. Extra semicolon.
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. 👍 |
||
| >>>>>>> 9cc7fb723ff8ffe9392ad605ffe3ae22362c6d63 | ||
| } | ||
|
|
||
| const tdue = dueDate || (startDate && moment(startDate) | ||
| .add(+isAllDay, 'days') // turn boolean into 1 or 0 | ||
|
|
||
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.
so, i think that this check/override should only happen when we create the the promise, so that this function still gives us what we expect
also, this will need to be a timezone aware check because we're going to change the criteria to reject any date that is in the past i.e.
< now(before, at a 1 year scale, being within 24 hours wouldn't really matter)this should happen before that
closeOfBusinesscheck so that the default will be applied (and you can look at that function for timezone handling)