Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Timezone #36

Merged
merged 3 commits into from Apr 16, 2019

Conversation

Projects
None yet
2 participants
@WizardLink
Copy link
Member

commented Feb 22, 2019

PR to add the TimezoneCommand and functionality with other commands (such as profile).

WizardLink added some commits Feb 9, 2019

@WizardLink WizardLink requested a review from SpaceEEC Feb 22, 2019

@WizardLink WizardLink self-assigned this Feb 22, 2019

@WizardLink WizardLink added the feature label Feb 22, 2019

@SpaceEEC
Copy link
Member

left a comment

There are also non full hour offsets (for example: Delhi - India).

args: string[],
{ authorModel }: ICommandRunInfo,
): (number | string)[] | string {
if (authorModel.timezone && !args.length) {

This comment has been minimized.

Copy link
@SpaceEEC

SpaceEEC Feb 28, 2019

Member

0 is a valid timezone, but falsy in js.

if (args[0] === 'remove') return args;

const offset: number = parseInt(args[0]);
if ((!offset && offset !== 0) || offset > 12 || Math.abs(offset) > 12) {

This comment has been minimized.

Copy link
@SpaceEEC

SpaceEEC Feb 28, 2019

Member

There are places off by more than 12 hours. Kiribati can be up to UTC+14.

@@ -77,14 +78,23 @@ class ProfileCommand extends Command {
: 'Single';
}

let userTime: string = 'No timezone set.';

if (userModel.timezone || userModel.timezone === 0) {

This comment has been minimized.

Copy link
@SpaceEEC

SpaceEEC Feb 28, 2019

Member

I think a userModel.timezone !== null or typeof userModel.timezone === 'number' would be more elegant.

@WizardLink WizardLink merged commit 72ab532 into stable Apr 16, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.