Spoke: ALL_OFFSETS (used to filter timezones for texting hours enforcement) should be configurable or eliminated

Created on 4 Feb 2018  路  3Comments  路  Source: MoveOnOrg/Spoke

//Currently only USA
const ALL_OFFSETS = [-4, -5, -6, -7, -8, -9, -10, -11, 10]

The comment is not accurate, by the way, because +10 is Australia eastern time.

This is used to establish which timezones are within texting hours at the current point in time relative to configured or default texting hours.

I see no reason not to just compute this for all offsets. It's probably a small optimization.

That having been said, if we're going to keep this, make it configurable so Spoke is portable to other regions without requiring a code change.

There are other ways to make this work without a list and without configuration, such as determining, for the current point in time, the easternmost and westernmost timezones that are within texting hours. That way we wouldn't have 2 lists with a total of 24 timezones, which I think is probably what they were trying to optimize for.

A-Timezone A-server-side (nodejs) good first issue help wanted

Most helpful comment

@ibrand short answer: yup, it was never done. There hasn't been a real use case for doing it in the 2 years that have elapsed since I create the issue.

All 3 comments

@lperson this was never done, was it?

@ibrand short answer: yup, it was never done. There hasn't been a real use case for doing it in the 2 years that have elapsed since I create the issue.

Was this page helpful?
0 / 5 - 0 ratings