Skip to content

Comments

Add Date/Time Picker component#25

Open
chetanupare wants to merge 2 commits intoRealZone22:v1from
chetanupare:feature/date-time-picker
Open

Add Date/Time Picker component#25
chetanupare wants to merge 2 commits intoRealZone22:v1from
chetanupare:feature/date-time-picker

Conversation

@chetanupare
Copy link
Contributor

@chetanupare chetanupare commented Feb 14, 2026

Closes #24

Adds reusable Date/Time Picker components as requested:

Date Picker (x-pengublade::date-picker)

  • Single date selection
  • Date range selection (mode="range")

Time Picker (x-pengublade::time-picker)

  • Hours and minutes selection
  • Optional seconds (:seconds="true")

Date + Time Picker (x-pengublade::date-time-picker)

  • Combined date and time in a single component
  • Optional seconds support

Uses native HTML5 inputs for accessibility; follows existing component patterns (label, hint, validation, tooltip, icon).

chetanupare and others added 2 commits February 14, 2026 11:51
- Date Picker: single date and date range selection
- Time Picker: hours/minutes with optional seconds
- Date + Time Picker: combined datetime-local input

Accessible, native HTML5 inputs; consistent with existing form components (label, hint, validation, tooltip, icon support).

Co-authored-by: Cursor <cursoragent@cursor.com>
@chetanupare
Copy link
Contributor Author

@RealZone22 ,
Please review and let me know if anything !

@RealZone22
Copy link
Owner

It looks good so far. As I am currently not home, I will take a look at it on Tuesday when I am back.

Copy link
Owner

@RealZone22 RealZone22 left a comment

Choose a reason for hiding this comment

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

Thanks for waiting.

Comment on lines +42 to +61
<input
type="date"
id="{{ $uuid }}-start"
aria-label="{{ $label ? $label.' (start)' : 'Start date' }}"
@if($nameBase) name="{{ $nameBase }}_start" @endif
@if($min) min="{{ $min }}" @endif
@if($max) max="{{ $max }}" @endif
@if($placeholder) placeholder="{{ $placeholder }}" @endif
{{ $baseAttrs->twMerge($inputClass) }}
/>
<span class="text-on-surface/60 dark:text-on-surface-dark/60 text-sm shrink-0" aria-hidden="true">–</span>
<input
type="date"
id="{{ $uuid }}-end"
aria-label="{{ $label ? $label.' (end)' : 'End date' }}"
@if($nameBase) name="{{ $nameBase }}_end" @endif
@if($min) min="{{ $min }}" @endif
@if($max) max="{{ $max }}" @endif
{{ $baseAttrs->twMerge($inputClass) }}
/>
Copy link
Owner

Choose a reason for hiding this comment

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

Can you tell me, why didn't you add support for wire:model? Maybe add two variables for start and end which will be used in wire:model

])

@php
$uuid = $uuid ?: 'dp-'.bin2hex(random_bytes(6));
Copy link
Owner

Choose a reason for hiding this comment

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

I looked at other components, and as far as I know, there was a problem with using PHP variables for UUIDs. Take a look at the input component, for example. There, the UUID is generated with x-data.

])

@php
$uuid = $uuid ?: 'dtp-'.bin2hex(random_bytes(6));
Copy link
Owner

Choose a reason for hiding this comment

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

Same here. Use the x-data for uuid generation

])

@php
$uuid = $uuid ?: 'tp-'.bin2hex(random_bytes(6));
Copy link
Owner

Choose a reason for hiding this comment

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

Same here. Use the x-data for uuid generation

<i class="{{ $icon }} absolute left-2.5 top-1/2 -translate-y-1/2 z-10 text-gray-500 dark:text-neutral-500 pointer-events-none"></i>
@endif

<div class="{{ $isRange ? 'flex flex-wrap items-center gap-2' : '' }} @if($icon) relative @endif">
Copy link
Owner

Choose a reason for hiding this comment

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

The flex-wrap let the two inputs appear under each other:

Image

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.

Add Date/Time Picker component

2 participants