Skip to content

Commit

Permalink
substack-members: guard against getMonth not being available
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulAdamDavis committed Jan 8, 2025
1 parent fd2fdb1 commit 0ada73a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/mg-substack-members-csv/lib/process.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const processCompGift = (member, {thresholdYearOrDate, beforeThreshold}) => {
const sType = member.type;
const thresholdDate = (typeof thresholdYearOrDate.getMonth === 'function') ? thresholdYearOrDate : new Date().setFullYear(new Date().getFullYear() + thresholdYearOrDate);
const thresholdDate = (typeof thresholdYearOrDate?.getMonth === 'function') ? thresholdYearOrDate : new Date().setFullYear(new Date().getFullYear() + thresholdYearOrDate);

if (new Date(member.expiry) > thresholdDate) {
member.type = 'comp',
Expand Down

0 comments on commit 0ada73a

Please sign in to comment.