Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
285
xamScheduleView - Show time periods as 24-hour slots
posted

Good Afternoon,

I am using the xamScheduleView to show appointments. The default time slots across the top show as a 12-hour clock, and I would like them to show as a 24-hour clock, for example 2:00 PM would shows as 14:00 instead of 2:00.  This would make the times across the top easier to delineate AM from PM.  Also I'm hoping the associated appointment will show the same 24-hour clock time. 

What would be the best way to accomplish this?

Thanks!

Alicia Kelley

Parents
No Data
Reply
  • 54937
    Verified Answer
    Offline posted

    There's two possibilities. First, the control uses the date time information provided by the DateInfoProviderResolved of the XamScheduleDataManager which by default uses a DateInfoProvider that wraps the information provided by the CultureInfo.CurrentCulture. So one option would be to set the XamScheduleDataManager's DateInfoProvider to a DateInfoProvider that wraps a CultureInfo whose date time information uses 24 hour or a derived DateInfoProvider that overrides the DisplayTimeIn24HourFormat and returns true. The other is something I mentioned in this reply. Essentially that element is the ScheduleViewTimeslotHeader element and its template contains a TimeslotHeaderTimePresenter that calculates and creates the elements used to represent the header. You could retemplate the ScheduleViewTimeslotHeader to contain a textblock instead that binds to the StartDate, etc. and renders using whatever format you set up.

Children