Bug Report T331591
Visible to All Users

DateEdit - The month caption does not change text when the VistaDateEditCalendar.DateFormat property is set

created 9 years ago (modified 9 years ago)

A DateEdit which is set to VistaDisplayMode does not respect a set DateFormat property for the header of the control in month Display.
E.g. if you have set a CurrentCulture to DE and have set DateFormat of the VistaDateEditCalendar to EN culture then you get a control which displays everything in german except the month name in the header line which will be in english.

The fixes should be:
In DateEditCalendar.cs in Class VistaDateEditInfoArgs replace

Code
public virtual string CaptionString { get { if(Calendar.View == DateEditCalendarViewType.MonthInfo) return DateTime.ToString(CultureInfo.CurrentCulture.DateTimeFormat.YearMonthPattern); with
Code
public virtual string CaptionString { get { if(Calendar.View == DateEditCalendarViewType.MonthInfo) return DateTime.ToString(DateFormat.YearMonthPattern, DateFormat);

You may also want to change:
public override string CurrentDateString { get { return DateTime.Today.ToString(DateFormat.LongDatePattern, DateFormat); } } public override string TimeString { get { return DateTime.Now.ToLocalTime().ToString(DateFormat.LongTimePattern, DateFormat); } }

Comments (3)
Nadezhda (DevExpress Support) 9 years ago

    Hello Andreas,

    It is not clear what you mean by "set DateFormat of the VistaDateEditCalendar to EN culture". Please clarify your scenario in greater detail. In addition, it will be great if you provide us with a small compilable project so that we can research it on our side.
    I am looking forward to your response.

      Consider the following code:
      VistaDateEditCalendar calendar = new VistaDateEditCalendar(base.OwnerEdit.Properties, base.OwnerEdit.EditValue);
      calendar.DateFormat = new CultureInfo("pt-BR").DateTimeFormat;
      If you use that calendar e.g. in a DateEdit you will get a calendar which uses the pt-BR daynames, but in the caption/header uses month-names from you CurrentCulture.

      DevExpress Support Team 9 years ago

        Hello Andreas,
        Thank you for the clarification. I will forward this ticket to our R&D team for further research. We will update it once we obtain any news.

        Answers approved by DevExpress Support

        created 9 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.