DateTimeFormat how to remove AM and PM ?

2 posts, 0 answers
  1. Terrence
    Terrence avatar
    4 posts
    Member since:
    Sep 2011

    Posted 02 Nov 2011 Link to this post

    According to their documentation “Link below” to set their date time picker to military time you have to create a new culture. We are using the culture below, as you can see from the screen shot it got it half way right but I think it would be better without the AM & PM after it.I attached a screen shot of the clock. We just want to remove the AM and PM.

     

    CultureInfo cultureInfo = new CultureInfo("en-US");

    cultureInfo.DateTimeFormat.ShortTimePattern = "H:mm";

    cultureInfo.DateTimeFormat.LongTimePattern = "H:mm";

    cultureInfo.DateTimeFormat.PMDesignator = "";

    cultureInfo.DateTimeFormat.AMDesignator = "";   

     

     

    http://www.telerik.com/help/wpf/raddatetimepicker-features-formatting.html

     

  2. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 03 Nov 2011 Link to this post

    Hi Andrew,

    I suspect you do not set RadDateTimePicker's culture:
    CultureInfo cultureInfo = new CultureInfo("en-US");
    cultureInfo.DateTimeFormat.ShortTimePattern = "H:mm";
    cultureInfo.DateTimeFormat.LongTimePattern = "H:mm";
    cultureInfo.DateTimeFormat.PMDesignator = " za";
    cultureInfo.DateTimeFormat.AMDesignator = " az";
    this.RadDateTimePicker.Culture = cultureInfo;

    Regards,
    Ivo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top