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

RadMonthYearPicker Bicker

7 Answers 180 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Scott MacFarlane
Top achievements
Rank 1
Scott MacFarlane asked on 16 Jun 2011, 07:42 PM
Hi,

I tried using the new RadMonthYearPicker and am quite dissapointed as Telerik seems to have
created this new control and yet totally missed the point.

Is not the whole purpose of the control to select - or enter - just the month and year, and not have a
day whatsoever? 

If you setup the date format as MM/yyyy and the display format at MM/yyyy (the first thing i tried and
imho the first thing most anybody will try) - the control doesn't work at ALL!!

I've seen all these huge, extended, hard-coding, client-side, work-arounds, of users trying to make
it do just that.

While I know any date variable or database value must have a day, why don't you just add another
paramater to specify the default day value returned and make it work as expected?

Just my two sense,
Scott

7 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 22 Jun 2011, 08:23 AM
Hello Scott,

If you set DateFormat string to "MM/yyyy"  and the entered value contains only "month" and "year" parts (for example "06/2011"), the embedded parsing mechanism of the RadDateInput control will parse the "month" part as a day and apply the current month to form the final date. In order to avoid the built-in parsing the developer must construct the date manually before it is applied to the input.
On the following code library you could find how to do that:
http://www.telerik.com/community/code-library/aspnet-ajax/calendar/how-to-use-raddatepicker-with-a-quot-mm-yyyy-quot-formatted-dateinput.aspx

Additionally the purpose of the RadMonthYearPicker control is to choose month and year. However the .NET framework does not have structure which could keep only month and year, so the MonthYearPicker keeps month and year into the DateTime object. Into this object the date part is populated by default from the picker control. The user could not see the date part and could not change it. The end user could  choose or change only month and year. The developers could get the selected date into the code behind and extract the month and year part from it and do whatever they want with this parts. Also into the code behind you could get the entire date object kept into the SelectedDate property of the control and save it into the database or operate directly with it.

Kind regards,
Radoslav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
RAY
Top achievements
Rank 1
answered on 25 Oct 2011, 09:21 PM
I agree with Scott in that (at least in the US), the most popular format for month and year would be "MM/yyyy".  The example,  "06/2011", should be interpreted as June 2011 (not current month 6th day 2011).   Unless there is some technical reason why this cannot work, someone really missed the boat on designing this thing.  What it should do is parse the "06/2011" and default the day to 1.   Then, the result fits the standard .NET datetime structure.  Then, in the DateTime structure, we can easily pick up the month and year parts.  
0
RAY
Top achievements
Rank 1
answered on 25 Oct 2011, 09:22 PM
I agree with Scott in that (at least in the US), the most popular format for month and year would be "MM/yyyy".  The example,  "06/2011", should be interpreted as June 2011 (not current month 6th day 2011).   Unless there is some technical reason why this cannot work, someone really missed the boat on designing this thing.  What it should do is parse the "06/2011" and default the day to 1.   Then, the result fits the standard .NET datetime structure.  Then, in the DateTime structure, we can easily pick up the month and year parts.  
0
Pete
Top achievements
Rank 1
answered on 26 Oct 2011, 02:10 AM
+1   

It seems as though the MonthYear Picker has no purpose if it doesn't work how Ray described ???

Cheers
0
Rodrigo
Top achievements
Rank 1
answered on 23 Jan 2013, 07:04 PM
+1
0
Jeffrey
Top achievements
Rank 1
answered on 26 May 2013, 10:01 AM
You completely missed Scott's point. Which may be why your developers and designers completely missed the mark on this control.
0
Radoslav
Telerik team
answered on 27 May 2013, 06:49 AM
Hello,

Our developers have changed the behavior of date parsing into the RadMonthYearPicker control and now it works as expected. If you have "MM/yyyy" as format string and the user enter "06/2011" the control will interpret this as June 2011. The improvement will be included into the official Q2 release which will be live in the middle of next month.

Regards,
Radoslav
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Calendar
Asked by
Scott MacFarlane
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
RAY
Top achievements
Rank 1
Pete
Top achievements
Rank 1
Rodrigo
Top achievements
Rank 1
Jeffrey
Top achievements
Rank 1
Share this question
or