Skip to content

feat: Round start day time to nearest 15 minutes#53

Merged
AdamJ merged 3 commits intomainfrom
date-time-picker-component
Feb 6, 2026
Merged

feat: Round start day time to nearest 15 minutes#53
AdamJ merged 3 commits intomainfrom
date-time-picker-component

Conversation

@AdamJ
Copy link
Owner

@AdamJ AdamJ commented Feb 6, 2026

Summary

This PR adds 15-minute interval rounding to the start day functionality, ensuring consistency with how new time entries are created.

Changes

  • TimeTrackingContext: Added rounding logic to startDay function that rounds to nearest 15-minute interval (0, 15, 30, or 45 minutes)
  • OfflineContext: Fixed react-refresh/only-export-components linting warning

Implementation Details

The startDay function now:

  1. Calculates the nearest 15-minute interval using Math.round(minutes / 15) * 15
  2. Creates a new Date object with the rounded time
  3. Resets seconds and milliseconds to 0 for clean timestamps

Examples

  • 9:08 AM → 9:15 AM
  • 9:23 AM → 9:30 AM
  • 9:52 AM → 9:45 AM
  • 9:53 AM → 10:00 AM

Testing

  • ✅ All tests pass
  • ✅ Linting passes with no warnings
  • ✅ Build completes successfully

Since the first task automatically uses the dayStartTime, it will also be aligned to the same 15-minute interval, maintaining consistency throughout the day.

AdamJ and others added 2 commits February 6, 2026 09:41
Create a reusable scroll-wheel time picker component that displays
three scrollable columns (hour, minute, AM/PM) for intuitive time
selection. Includes snap-to-item behavior, selection highlight band,
fade overlays, and 24-hour format conversion. Also adds scrollbar-hide
CSS utility for cross-browser hidden scrollbar support.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add 15-minute interval rounding to startDay function
- Ensures first task aligns with rounded start time
- Fix react-refresh linting warning in OfflineContext
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 6, 2026

Deploying timetrackerpro with  Cloudflare Pages  Cloudflare Pages

Latest commit: e5b1f9f
Status: ✅  Deploy successful!
Preview URL: https://5719eb26.timetrackerpro.pages.dev
Branch Preview URL: https://date-time-picker-component.timetrackerpro.pages.dev

View logs

@AdamJ AdamJ merged commit 8c7a38b into main Feb 6, 2026
2 checks passed
@AdamJ AdamJ deleted the date-time-picker-component branch February 6, 2026 15:56
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