Skip to content

fix: handle DST gap correctly and prevent iteration from stopping prematurely#405

Open
cyber-hari wants to merge 1 commit intoharrisiirak:masterfrom
cyber-hari:fix/dst-iteration-bug
Open

fix: handle DST gap correctly and prevent iteration from stopping prematurely#405
cyber-hari wants to merge 1 commit intoharrisiirak:masterfrom
cyber-hari:fix/dst-iteration-bug

Conversation

@cyber-hari
Copy link
Copy Markdown

@cyber-hari cyber-hari commented Apr 23, 2026

Description

  • Fix issue where iteration stops after DST spring-forward transition
  • Ensure valid occurrences after DST gap are returned
  • Prevent hasNext() from returning false incorrectly
  • Prevent next() from returning undefined for valid future times
  • Cover gap times and post-DST valid times

Fixes #404

Type of Change

Please check the relevant option:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (changes to documentation only)
  • Code refactoring (no functional changes)
  • Performance improvement
  • Test improvement or addition
  • Build/CI/tooling changes

Testing

Describe how you've tested your changes:

  • All tests pass (npm test)
  • Code coverage is maintained or improved

Changes Made

List the main changes in this pull request:

Related Issues

List any issues that are related to this PR:

Documentation

  • Code is self-documenting with clear variable/function names
  • Complex logic has helpful comments
  • Public API changes are documented with JSDoc
  • README updated (if user-facing changes)

Performance

If this PR affects performance:

  • Benchmarks were run before and after changes
  • Performance impact is acceptable or improved
  • Results are documented in comments or PR description

Breaking Changes

If this introduces breaking changes:

  • Breaking changes are clearly documented
  • Migration guide provided (if needed)
  • Version bump strategy discussed
  • Backwards compatibility considered

Code Quality

  • Code follows project style guidelines
  • ESLint checks pass (npm run lint)
  • Prettier formatting applied (npm run format)
  • TypeScript compilation successful (npm run build)
  • No new TypeScript errors or warnings

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • My code follows the project's coding standards
  • I have added tests for my changes
  • All tests pass locally
  • I have updated documentation as needed
  • My commits have clear, descriptive messages
  • I have rebased my branch on the latest master

Additional Notes

Any additional information, context, or notes for reviewers:

…maturely

- Fix issue where iteration stops after DST spring-forward transition
- Ensure valid occurrences after DST gap are returned
- Prevent hasNext() from returning false incorrectly
- Prevent next() from returning undefined for valid future times
- Cover gap times and post-DST valid times
@cyber-hari
Copy link
Copy Markdown
Author

@harrisiirak

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.

[BUG] DST transition causes hasNext() to return false / next() to return undefined for valid future times (Europe/Rome)

1 participant