Skip to content

Commit

Permalink
[MWPW-164170] Update RCP dates for 2025 (#3371)
Browse files Browse the repository at this point in the history
  • Loading branch information
overmyheadandbody authored Dec 12, 2024
1 parent 28dc5d2 commit d543279
Showing 1 changed file with 41 additions and 21 deletions.
62 changes: 41 additions & 21 deletions .github/workflows/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,62 @@
const owner = process.env.REPO_OWNER || ''; // example owner: adobecom
const repo = process.env.REPO_NAME || ''; // example repo name: milo
const auth = process.env.GH_TOKEN || ''; // https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
const CURRENT_YEAR = 2024;
const RCPDates = [
{
start: new Date('2024-05-26T00:00:00-07:00'),
end: new Date('2024-06-01T00:00:00-07:00'),
start: new Date('2024-12-12T11:00:00-08:00'),
end: new Date('2024-12-12T14:00:00-08:00'),
},
{
start: new Date('2024-06-13T11:00:00-07:00'),
end: new Date('2024-06-13T14:00:00-07:00'),
start: new Date('2024-12-15T00:00:00-08:00'),
end: new Date('2025-01-02T00:00:00-08:00'),
},
{
start: new Date('2024-06-30T00:00:00-07:00'),
end: new Date('2024-07-06T00:00:00-07:00'),
start: new Date('2025-02-23T00:00:00-08:00'),
end: new Date('2025-03-01T00:00:00-08:00'),
},
{
start: new Date('2024-08-25T00:00:00-07:00'),
end: new Date('2024-08-31T00:00:00-07:00'),
start: new Date('2025-03-12T11:00:00-07:00'),
end: new Date('2025-03-12T14:00:00-07:00'),
},
{
start: new Date('2024-09-12T11:00:00-07:00'),
end: new Date('2024-09-12T14:00:00-07:00'),
start: new Date('2025-03-17T00:00:00-07:00'),
end: new Date('2025-03-20T17:00:00-07:00'),
},
{
start: new Date('2024-10-07T00:00:00-07:00'),
end: new Date('2024-10-18T17:00:00-07:00'),
start: new Date('2025-05-25T00:00:00-07:00'),
end: new Date('2025-05-31T00:00:00-07:00'),
},
{
start: new Date('2024-11-17T00:00:00-08:00'),
end: new Date('2024-11-30T00:00:00-08:00'),
start: new Date('2025-06-12T11:00:00-07:00'),
end: new Date('2025-06-12T14:00:00-07:00'),
},
{
start: new Date('2024-12-12T11:00:00-08:00'),
end: new Date('2024-12-12T14:00:00-08:00'),
start: new Date('2025-06-29T00:00:00-07:00'),
end: new Date('2025-07-05T00:00:00-07:00'),
},
{
start: new Date('2024-12-15T00:00:00-08:00'),
end: new Date('2025-01-02T00:00:00-08:00'),
start: new Date('2025-08-24T00:00:00-07:00'),
end: new Date('2025-08-30T00:00:00-07:00'),
},
{
start: new Date('2025-09-11T11:00:00-07:00'),
end: new Date('2025-09-11T14:00:00-07:00'),
},
{
start: new Date('2025-10-06T00:00:00-07:00'),
end: new Date('2025-10-16T17:00:00-07:00'),
},
{
start: new Date('2025-11-16T00:00:00-08:00'),
end: new Date('2025-11-29T00:00:00-08:00'),
},
{
start: new Date('2025-12-10T11:00:00-08:00'),
end: new Date('2025-12-10T14:00:00-08:00'),
},
{
start: new Date('2025-12-14T00:00:00-08:00'),
end: new Date('2026-01-04T00:00:00-08:00'),
},
];

Expand All @@ -49,8 +68,9 @@ const isShortRCP = (start, end) => {

const isWithinRCP = ({ offset = 0, excludeShortRCP = false } = {}) => {
const now = new Date();
if (now.getFullYear() !== CURRENT_YEAR) {
console.log(`ADD NEW RCPs for ${CURRENT_YEAR + 1}`);
const lastRcpDate = RCPDates.reverse()[0];
if (now > lastRcpDate.end) {
console.log('ADD NEW RCPs for the current year');
return true;
}

Expand Down

0 comments on commit d543279

Please sign in to comment.