Browse only year and month in any date picker

Hello,

I would like use a DatePicker control that shows only the year and months in dropdown panel. After the user click on Month the days sub-panel should not be opened.

This is the goal:

Image_9841_1698424329352

But I dont want to show the days in this sub-panel, it should not be opened after click on month:

Image_7071_1698424361020


Can I do this with any date picker control?

Thank you!

BR, SZL


6 Replies

MJ Madhumithan Jayapathi Syncfusion Team November 1, 2023 01:55 PM UTC

Hi SZL,


We have validated your query, and you can achieve the behavior you described by configuring SfDateTimeEdit to only allow browsing of years and months. You can achieve this by setting the MonthCalendar as CalendarViewType.Year. Please note that this functionality is not available in the latest NuGet releases because of a break, but we plan to provide a fix in the upcoming NuGet release on November 7, 2023. We appreciate your patience until then.


Regards,
Madhumithan Jayapathi


Attachment: SfDateTimeEdit_Issue_9372f47a.zip


SZ SZL replied to Madhumithan Jayapathi November 2, 2023 01:26 PM UTC

Hello,


Thank you, its working in your example with version (22.2460.10.0). For some reason in my version (21.1.41) the date is not changing after click on month. I should update the nuget?

After upgrade the demo project to latest version (23.1460.43.0) it shows the days too. If I good understand that will be fixed in next release?

Can I close the date selector popup after the user clicks on month?


Thank you!


BR, László





MJ Madhumithan Jayapathi Syncfusion Team November 3, 2023 02:03 PM UTC

Hi SZL,


Query 1 - Nuget Release:

We have validated your query, and yes, this functionality is will be available in the upcoming NuGet release on November 7, 2023. We appreciate your patience until then.

 

Query 2 - PopUp Closing after Value Changed:

You can close the date selector popup after selecting a value in the popup by handling the ValueChanged event and using the ClosePopUp method of SfDateTimeEdit. We have attached a sample for your reference. If you require any further assistance, please don't hesitate to ask.


Regards,

Madhumithan Jayapathi




SZ SZL replied to Madhumithan Jayapathi November 4, 2023 04:08 PM UTC

Hi,

Thank you very much for help!



SZ SZL November 11, 2023 10:06 AM UTC

I try with the new version, its working fine, thank you!



GM Gilbert Manoj Rajamanikkam Syncfusion Team November 13, 2023 06:20 AM UTC

Hi SZL,

We hope that your issue has been fixed. Please let us know if you need any other assistance. We are happy to assist you.

Regards,

Gilbertmanoj R.


Loader.
Up arrow icon