This is a migrated thread and some comments may be shown as answers.

Date Suggestion Tooltip

5 Answers 18 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Premkumar
Top achievements
Rank 1
Premkumar asked on 19 Sep 2018, 01:11 PM

Hi Progress Telerik,

When I type the date 01 09 18, the tooltip suggests 18 Sep 2001.

But when I type 01 09 2018, the tooltip suggests 01 Sep 2018.

I want the suggestion date to be 01 Sep 2018 when I type 01 09 18.

I'm using the CultureInfo en-US and date format dd MMM yyyy.

Kindly assist on how to achieve the same.

 

Thank You,

With Best Regards,

Muhammad Azhar Shah

5 Answers, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 21 Sep 2018, 12:24 PM
Hi Muhammad,

To achieve the desired result, you also need to set the DateSeparator property of the culture's DateTimeFormat to a space:

picker.Culture.DateTimeFormat.DateSeparator = " ";

Please let me know if this works for you.

Regards,
Dilyan Traykov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Premkumar
Top achievements
Rank 1
answered on 22 Sep 2018, 11:28 AM

Hi Dilyan,

Thank you very much. That is working as expected.

 

Regards,

Muhammad Azhar Shah

0
Premkumar
Top achievements
Rank 1
answered on 25 Sep 2018, 08:45 AM

Hi Progress Telerik,

Thank You once again for the solution given.

There is another requirement to be fulfilled here. Whenever I type the first set of numbers then it should be interpreted as Day only, not month. After applying DateTimeFormat.DateSeparator = " ", I'm facing an issue.

If I type 11 => suggesting as 11 Sep 2018 which is what I want.

But when I type 11 2 => suggesting as 02 Nov 2018 which I don't want. I want the suggestion date to be 11 Feb 2018 here. Meaning that the first set of numbers should be interpreted as Day.

Similarly, when I type 13 02 => displays error, But I want it to be 13 Feb 2018.

Please find the attached image.

This requirement should not disturb my previous requirement. When I type 01 09 18, it should display 01 Sep 2018.

Hope you understand my requirements. Kindly give me a solution to fix the same.

 

Thank You,

With Best Regards,

Muhammad Azhar Shah

0
Accepted
Dilyan Traykov
Telerik team
answered on 25 Sep 2018, 02:28 PM
Hello Muhammad,

For the parsings you specified to work, you need to set the MonthDayPattern of the culture's DateTimeFormat:

picker.Culture.DateTimeFormat.MonthDayPattern = "dd MM";

Doing so provides the desired result at my end. Please let me know if that is the case for you as well.

Regards,
Dilyan Traykov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Premkumar
Top achievements
Rank 1
answered on 26 Sep 2018, 06:10 AM

Hi Dilyan,

Thumbs up. Thank You.

 

Regards,

Muhammad Azhar Shah

Tags
DateTimePicker
Asked by
Premkumar
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Premkumar
Top achievements
Rank 1
Share this question
or