Repository navigation
Ignore edits to issues predating the bot - #13460
Conversation
|
Should fix the scenario described in #10843 (comment). |
|
/cc @Hainish @koops76 |
|
|
||
| const createdAt = new Date(context.payload.issue.created_at); | ||
| // September 25th, 2017 | ||
| if (createdAt.getFullYear() <= 2017 && createdAt.getMonth() <= 8 && createdAt.getDate() <= 25) { |
There was a problem hiding this comment.
This conditional will fail for an issue created in September, 2016.
There was a problem hiding this comment.
The cleanest way to do this without a long conditional is probably formatted string comparison. Munge createdAt into YYYY-MM-DD format, then compare it to "2017-08-25"
There was a problem hiding this comment.
Can't we compare Dates directly, or at least by conversion to timestamps?
There was a problem hiding this comment.
@Hainish Better way is to compare dates directly.
There was a problem hiding this comment.
@Hainish nice catch. Will push a fix based on #13460 (comment)
|
|
||
| const createdAt = new Date(context.payload.issue.created_at); | ||
| // September 25th, 2017 | ||
| if (createdAt.getFullYear() <= 2017 && createdAt.getMonth() <= 8 && createdAt.getDate() <= 25) { |
There was a problem hiding this comment.
const botCreatedDate = new Date(2017, 10, 25)
if (createdAt <= botCreatedDate) {There was a problem hiding this comment.
Nice, thanks! I had no idea you could compare Dates like this; I was gonna compare Unix timestamps.
b6232e9 to
1fb5445
Compare
|
Fixed the date comparison and rebased on master. |
|
Also pushed an unrelated test suite improvement that didn't seem worth sending a separate PR for. |
No description provided.