Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/memoize-timezonedst' into stage-…
Browse files Browse the repository at this point in the history
…main-10-1d
  • Loading branch information
schuyler1d committed Apr 9, 2021
2 parents 1fe295e + ab7e624 commit 15436cd
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/lib/timezones.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,21 @@ export function convertOffsetsToStrings(offsetArray) {
}

export const getOffsets = (config, campaignOffsets) => {
const offsets = campaignOffsets || ALL_OFFSETS;
// TODO: campaignOffsetes will sometimes have an array of e.g. ['-5_1', ...]
// future we should split that out and then only process the dst/offset cases passed in
const offsets = /*campaignOffsets || */ ALL_OFFSETS;
const valid = [];
const invalid = [];

const dst = [true, false];
dst.forEach(hasDST =>
offsets.forEach(offset => {
if (isBetweenTextingHours({ offset, hasDST }, config)) {
valid.push([offset, hasDST]);
} else {
invalid.push([offset, hasDST]);
if (offset) {
if (isBetweenTextingHours({ offset, hasDST }, config)) {
valid.push([offset, hasDST]);
} else {
invalid.push([offset, hasDST]);
}
}
})
);
Expand Down

0 comments on commit 15436cd

Please sign in to comment.