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: Add viewDate property #12157

Open
jfermat opened this issue Jun 20, 2024 · 4 comments
Open

DatePicker: Add viewDate property #12157

jfermat opened this issue Jun 20, 2024 · 4 comments
Assignees
Milestone

Comments

@jfermat
Copy link

jfermat commented Jun 20, 2024

Description

I am unable to migrate component Calendar to DatePicker.

In Calendar I have the attributes defaultHour, defaultMinute, defaultSecond, defaultMillise that in case I don't have any value it sets the default time according to its values.

In DatePicker these attributes do not exist and it sets the current time.

Describe the solution you would like

Add defaultHour, defaultMinute, defaultSecond, defaultMillisec attributes to DatePicker to perform the same functionality as the Calendar component.

Additional context

No response

@melloware
Copy link
Member

melloware commented Jun 20, 2024

This was also recently requested on Discussions: https://github.com/orgs/primefaces/discussions/2137

In PrimeReact this property is called viewDate see: https://primereact.org/calendar/#api.Calendar.props.viewDate

Date instance whose month and year are used to display the calendar.

i think we should call it viewDate to be consistent.

@melloware melloware removed the ‼️ needs-triage Issue needs triaging label Jun 20, 2024
@melloware melloware self-assigned this Jun 20, 2024
@melloware melloware added this to the 15.0.0 milestone Jun 20, 2024
@melloware melloware changed the title DatePicker: Add default time in case the value is null. DatePicker: Add viewDate property Jun 20, 2024
@jfermat
Copy link
Author

jfermat commented Jun 21, 2024

The viewDate attribute would not be useful to solve the reported problem.

According to the migration from Primefaces 8.0.0 to 10.0.0 it is recommended to change the Calendar to DatePicker because the Calendar was deprecated.

The Calendar has the attributes to initialize the time in case the value is null.
https://primefaces.github.io/primefaces/14_0_0/#/components/calendar

Example:
<p:calendar value="#{calendarView.date}" defaultHour="23" defaultMinute="59" defaultSecond="59" />

calendar-defaultTime-withoutValue

However,DatePickers do not have them and I would need this functionality.
https://primefaces.github.io/primefaces/14_0_0/#/components/datepicker

@melloware
Copy link
Member

Agreed. I marked this for 15.0.0

@tandraschko
Copy link
Member

would be great ticket for sponsoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants