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

Alarms set for 12:xx am or 12:xx pm fire at the wrong time #143

Closed
pcherna opened this issue Jul 31, 2020 · 2 comments
Closed

Alarms set for 12:xx am or 12:xx pm fire at the wrong time #143

pcherna opened this issue Jul 31, 2020 · 2 comments

Comments

@pcherna
Copy link

pcherna commented Jul 31, 2020

Running version 2.2.3 under MacOS 10.14.6

I have a few alarms set between 12:15am and 12:30am, and they were firing an hour early:

image

The bug is in timeService.js, checkTime, which reads:

// convert am/pm to 0-24, am: 1-12 -> 1-12, pm: 1-11,12 -> 13-23,0
if( rMode === 'am' ) {
	rHour = (rHour !== 12) ? rHour : 23;
} else if( rMode === 'pm' ) {
	rHour = (rHour !== 12) ? rHour + 12 : 0;
} // else 24 hour mode

The adjusted values for rHour when rHour begins as 12 are wrong, and should be as follows:

// convert am/pm to 0-24, am: 1-11,12 -> 1-11,0, pm: 1-11,12 -> 13-23,12
if( rMode === 'am' ) {
	rHour = (rHour !== 12) ? rHour : 0;
} else if( rMode === 'pm' ) {
	rHour = (rHour !== 12) ? rHour + 12 : 12;
} // else 24 hour mode
@todbot
Copy link
Owner

todbot commented Jul 31, 2020

Thank you! I'm prepping a release soon. I'll add this fix in.

@pcherna
Copy link
Author

pcherna commented Jul 31, 2020

I see the code has some support for 24 hour mode but I couldn't find how to use that. That would have let me avoid the bug till then. Instead, I'm just using an IFTTT trigger for now. -- Cheers, and thanks.

@todbot todbot closed this as completed in b274222 Sep 3, 2020
@todbot todbot reopened this Sep 3, 2020
@todbot todbot closed this as completed Sep 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants