Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
230 views

Hello,

We have an application that is used by clients from different countries in multiple languages. The date and number formats have to be the same for all clients in a certain country, the language can be selected by the user.

This works well by specifying the Thread.CurrentThread.CurrentCulture for the date and number formats and the Thread.CurrentThread.CurrentUICulture for the culture of the user's language.

When formatting dates, the names of the days and months are taken from the CurrentCulture. To make sure these names match the UICulture, we copy the names from the UICulture to the Culture. This works fine in most situations (for example in the DateTime.Format() function).

The behaviour of the RadDatePicker and RadMonthYearPicker seems a bit off though. In the picker (popup) the day and month names are correctly taken from the culture as we set them. In the input field however, the original day and month names are used. This seems wrong to me. Are we doing something wrong, or is this a bug in how the date pickers use the culture settings?


            var uiCulture = CultureInfo.CreateSpecificCulture("nl-NL");

            var customCulture = CultureInfo.CreateSpecificCulture("en-US");
            customCulture.DateTimeFormat.AbbreviatedDayNames = uiCulture.DateTimeFormat.AbbreviatedDayNames;
            customCulture.DateTimeFormat.DayNames = uiCulture.DateTimeFormat.DayNames;
            customCulture.DateTimeFormat.AbbreviatedMonthGenitiveNames = uiCulture.DateTimeFormat.AbbreviatedMonthNames;
            customCulture.DateTimeFormat.AbbreviatedMonthNames = uiCulture.DateTimeFormat.AbbreviatedMonthNames;
            customCulture.DateTimeFormat.MonthNames = uiCulture.DateTimeFormat.MonthNames;
            customCulture.DateTimeFormat.MonthGenitiveNames = uiCulture.DateTimeFormat.MonthGenitiveNames;
            customCulture.DateTimeFormat.ShortestDayNames = uiCulture.DateTimeFormat.ShortestDayNames;


            Thread.CurrentThread.CurrentCulture = customCulture;
            Thread.CurrentThread.CurrentUICulture = uiCulture;

 


The day and month names of the picker are localized, the input field is not.

 

Thanks for any suggestions,
Cloud9Software.

MC
Top achievements
Rank 1
Iron
 updated answer on 19 Jun 2023
8 answers
1.0K+ views

 

Hi guys,

 

I'm using 2 MonthYearPickers on a page and need that one of them to show only the year.

 

How can i do this? Tryed the css solution with #rcMView_month but that changes for both controls.

 

Thanks,

Antonio

 

DAVY
Top achievements
Rank 1
Iron
 answered on 29 Mar 2023
0 answers
81 views

This isn't an actual problem, but more of a curiosity.  Why does something called the RadMonthYearPicker still render a full date and time?  I thought that's what the RadDatePicker was for?  It should just give me the Month and Year and no date...which is what it's name would lead you to believe is all that would be involved.  I'm not choosing June 1st 2022.  I'm choosing June 2022.  I understand that I can format the selected date...that's not the point. 

Things that make you go hummmmm. 

SSirica
Top achievements
Rank 3
Iron
Iron
Iron
 asked on 21 Jun 2022
0 answers
123 views
hi sir,
             i use the above code posted on 11 -10-20216 that one we have facing the problem when we selected the year is hide  and click ok that year show in textbox. below example i show in screenshot.

the enable.png i put only one 
.monthCellClass {
        display: none;
    }
but it show month also 
the disable.png  i put both 
     .monthCellClass {
        display: none;
    }
 
   .rcSelected {
        display:none;
    }

it dose not show month but select year is not show that i mark in red box.

Note: I need to show only year not month.
M Kumar
Top achievements
Rank 1
Iron
Veteran
 asked on 14 Dec 2020
4 answers
221 views

Hi,

could somebody give me an advice, whether it's possible to have months in the same format as years ? I mean, now there are Jan. , Feb. .. and I want there only month numbers 01, 02.

And my second issue is how to change selected row value. Now, when I choose some month and year and click on OK button, there is January 2020. I need selected date in the format 01/2020, or 02/2020

Please, help me to solve this issues.

Regards

Vasssek

Vasssek
Top achievements
Rank 1
 answered on 11 Mar 2020
1 answer
37 views

I'm attempting to use the RadMonthYearPicker inside of a RadGrid EditItemTemplate in BatchEdit mode and I'm having an issue getting the picker to accept and exit all forms of it's editors when the user clicks 'OK'

I've attached a screenshot to help illustrate what I mean.

I have a OnBatchEditCellValueChanged function that then validates the date selected and pulls some DB values to other columns.

I have everything working like I want it accept when using the picker you have to manually click off the row before the changed event will fire.

I've tried several different methods of moving the cursor, setting focus, blurs, saving the table via batch manager and I'm sure a few other things and haven't had success yet.

Any direction at this point would be much appreciated. 

Attila Antal
Telerik team
 answered on 13 Aug 2019
4 answers
70 views

I would like to use the RadMonthYearPicker Component in an application with Swedish language. I need two Controls for letting the users to define a period. But I have a problem with setting the texts on the Today and Cancel buttons.

I've tried changing the settings in MonthYearNavigationSettings in the Page_Load, but just the first call for each Component makes an impact on the result.

For example:

rmypFromDatum.MonthYearNavigationSettings.CancelButtonCaption = "Avbryt";
rmypFromDatum.MonthYearNavigationSettings.TodayButtonCaption = "Idag";
rmypTomDatum.MonthYearNavigationSettings.TodayButtonCaption = "Idag";
rmypTomDatum.MonthYearNavigationSettings.CancelButtonCaption = "Avbryt";

then in the first Component, rmypFromDatum, the text on the Cancel Button is changed to "Avbryt", but the text on the Today button is English - Today. And vice versa - on the second Component the Today button has the text changed to "Idag" but the Cancel button has the text "Cancel.

When a button is clicked on the page and the page is reloaded both the buttons - Today and Cancel - get the Swedish texts.

What shall I do to make my Changes to be visible the first time the users open the Components. Please help!

Best regards,

Jenny

 

 

 

Eyup
Telerik team
 answered on 21 Jan 2019
0 answers
50 views

Hello everyone, 

I want to change my date input format in client side using Javascript.

I saw there is a get_dateInput but I don't know how to use it to set the RadMonthYearPicker format to "MMMM".

Do anyone have a simple example? 

Thank you in advance. 

Romaric
Top achievements
Rank 1
 asked on 28 Feb 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?