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

Filter out empty generated intervals #66

Merged
merged 1 commit into from
May 12, 2016
Merged

Conversation

craiglittle
Copy link
Collaborator

When short intervals are generated around the DST spring-forward point, it's possible to generate nonsensical empty intervals because of how the logic compensates for impossible times during the spring-forward hour by adding an hour to the time.

Due to this possibility, the period generator should protect against these empty intervals before emitting a period.

@zendesk/darko

let(:hours) { {sun: {'02:30' => '03:15'}, mon: {'09:00' => '17:00'}} }
let(:time_zone) { 'America/Los_Angeles' }

let(:origin) { in_zone('America/Los_Angeles') { Time.utc(2006, 4, 2, 0) } }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍁

@ghost
Copy link

ghost commented May 12, 2016

👍

When short intervals are generated around the DST spring-forward point,
it's possible to generate nonsensical empty intervals because of how the
logic compensates for impossible times during the spring-forward hour by
adding an hour to the time.

Due to this possibility, the period generator should protect against
these empty intervals before emitting a period.
@craiglittle craiglittle force-pushed the craig/filter-empty branch from e3f6e51 to 049cc13 Compare May 12, 2016 07:31
@craiglittle craiglittle merged commit 3d1f053 into master May 12, 2016
@craiglittle craiglittle deleted the craig/filter-empty branch May 12, 2016 07:36
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

Successfully merging this pull request may close these issues.

1 participant