Skip to content

Commit

Permalink
Changelog: Replace date-fns isBefore with a Date comparison
Browse files Browse the repository at this point in the history
Change-type: patch
  • Loading branch information
thgreasi committed Dec 21, 2023
1 parent 3bdfade commit 13722d3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/extra/Changelog/helpers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { isBefore } from 'date-fns'

export default (data) => {
const untilDate = new Date(new Date().setDate(new Date().getDate() - 90));
const versionDateStringMatches =
Expand All @@ -11,7 +9,7 @@ export default (data) => {
for (let i = 0; i < versionDateStringMatches.length; i++) {
foundMatch = true;
const firstOlderDateString = versionDateStringMatches[i];
if (isBefore(new Date(firstOlderDateString.split('(')[1].split(')')[0]), untilDate)) {
if (new Date(firstOlderDateString.split('(')[1].split(')')[0]) < untilDate) {
firstOlderDateIndex = i;
break;
}
Expand Down

0 comments on commit 13722d3

Please sign in to comment.