How to set display date only have mm/yyyy?

13 posts, 0 answers
  1. tungnt185
    tungnt185 avatar
    40 posts
    Member since:
    Aug 2009

    Posted 26 Jan 2011 Link to this post

    Hi Telerik team,

    I've a question is how to display selecteddate in mm/yyyy format (remove day).
    I've already set DateSelectionMode to Month but it's only for selecting a month not for displaying mm/yyyy format.
    It's always show 1/mm/yyyy but  I don't want day, I want it's mm/yyyy.
    So what's solution for this problem?

    Thanks.
  2. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 28 Jan 2011 Link to this post

    Hello Taufik Hidayat,

    This is configurable vie the DateTimeFormat property. Follow the code posted bellow it will help you:

    radDateTimePicker.Culture = new System.Globalization.CultureInfo("en-US"
             DateTimeFormat = new System.Globalization.DateTimeFormatInfo 
                          
                                ShortDatePattern = "MM/yyyy" 
                         }
    };


    Greetings,
    Kaloyan
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
  4. tungnt185
    tungnt185 avatar
    40 posts
    Member since:
    Aug 2009

    Posted 07 Feb 2011 Link to this post

    Thanks Kolayan,

    I've configured and it's worked fine.
    But there are an error here, Calendar Popup doesn't apply by culture.
    It's always is "en-US" culture.
    I don't know either this is a problem of control or my own.

    Thanks.
  5. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 11 Feb 2011 Link to this post

    Hello Taufik Hidayat,

    Sorry for the late response. What culture are you trying to set? The RadCalendar is not supporting some
    Asian cultures.

    All the best,
    Kaloyan
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  6. tungnt185
    tungnt185 avatar
    40 posts
    Member since:
    Aug 2009

    Posted 15 Feb 2011 Link to this post

    Hi Kaloyan,

    I'm using culture "vi-VN" Vietnamese.
    Is it supported by the RadCalendar? And if no so when it's supported?

    Regards.

  7. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 17 Feb 2011 Link to this post

    Hello Taufik Hidayat,

    The Vietnamese is not currently supported. We have already logged the task in our TFS system.

    All the best,
    Kaloyan
    the Telerik team
  8. tungnt185
    tungnt185 avatar
    40 posts
    Member since:
    Aug 2009

    Posted 17 Feb 2011 Link to this post

    Thanks Kaloyan,

    Could I know which version resolve this problem?
    My application really need it asap.

    Best regards.
  9. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 22 Feb 2011 Link to this post

    Hi Taufik Hidayat,

    Currently there is no estimated timeframe for the development of this feature.

    Regards,
    Kaloyan
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  10. Yao
    Yao avatar
    8 posts
    Member since:
    May 2010

    Posted 02 Sep 2011 Link to this post

    HI,ADMIN, 
    is supporting zn-CN cultures of RadCalendar?

    my code:
                   this.dpDate.Culture = new System.Globalization.CultureInfo("zh-CN")
                {
                    DateTimeFormat = new System.Globalization.DateTimeFormatInfo { ShortDatePattern = "yyyy-MM" }
                };

    but It's always "en-US" culture.

    Thanks!
  11. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 02 Sep 2011 Link to this post

    Hi Yao,

    I've tested the provided code with the latest version of RadDateTimePicker and it works without a problem at our side, please check the attachment.

    All the best,
    Yana
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  12. Yao
    Yao avatar
    8 posts
    Member since:
    May 2010

    Posted 04 Sep 2011 Link to this post

    Thanks Yana, 
     
    i'm tested another verison (2011.2.712.1040), but it's the same problem

    can you share your demo?

    thanks!
  13. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 06 Sep 2011 Link to this post

    Hello Yao,

    Using the DateTimeFormatInfo constructor directly in your application creates date/time information for the invariant culture only. Instead of creating a new instance of DateTimeFormatInfo you should just override some of the values associated with the chosen culture. Here is sample code how this should be done:
    this.radDateTimePicker.Culture = new System.Globalization.CultureInfo("zh-CN");
    this.radDateTimePicker.Culture.DateTimeFormat.ShortDatePattern = "yyyy-MM";

    Sorry for the inconvenience caused.
     
    Best wishes,
    Ivo
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  14. Yao
    Yao avatar
    8 posts
    Member since:
    May 2010

    Posted 07 Sep 2011 Link to this post

    thanks,
    This problem has been resolved!
Back to Top
DevCraft banner