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

DatePicker Defaults to minDate Instead of Current Month When Opening the Field #15113

Open
dharen008 opened this issue Dec 17, 2024 · 2 comments
Labels

Comments

@dharen008
Copy link

dharen008 commented Dec 17, 2024

Package

filament/filament

Package Version

3.2.131

Laravel Version

11.35.1

Livewire Version

3.5.12

PHP Version

8.2

Problem description

If the DatePicker is set up like this

now() = Dec

DatePicker::make( 'date' )
->minDate( October )
->maxDate( End of December )

When you click on the date field, the displayed month will default to minDate (October) instead of the current month (December).

Expected behavior

If possible, we should add an option to select the default focus month when clicking the date field or provide a way to prevent the focus from being forced to the minDate.

Steps to reproduce

  1. Set up the DatePicker with the following configuration:
    now() = March

DatePicker::make('date')
->minDate(April)
->maxDate(December)

  1. Open the DatePicker by clicking on the date field.

  2. Observe the displayed month:
    Instead of focusing on the current month (Dec), the DatePicker will default to the minDate (October).

Reproduction repository (issue will be closed if this is not valid)

https://github.com/dharen008/demo

Relevant log output

No response

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar
@danharrin
Copy link
Member

I don't see where in the reproduction repository this is?

@dharen008
Copy link
Author

oh sorry, the sample code is in the app/Filament/Resources/UserResource.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

2 participants