Hi, please tell me how to set 24h time format, and how to modify the IntervalSpans collection in the program code. As I understand it in the Q1 2013 release (version 2013.1.0220) this is possible.
1 Answer, 1 is accepted
0
Missing User
answered on 26 Mar 2013, 09:17 AM
Hello Sergey,
You have to write your own format provider that implements IIntervalFormatterProvider (found in the Telerik.Windows.Controls.TimeBar namespace):
public class HourIntervalFormatter : IIntervalFormatterProvider
{
public Func<DateTime, string>[] GetFormatters(IntervalBase interval)
{
return new Func<DateTime, string>[]
{
date => date.ToString("HH")
};
}
public Func<DateTime, string>[] GetIntervalSpanFormatters(IntervalBase interval)
{
return new Func<DateTime, string>[]
{
date => date.ToString("HH")
};
}
}
Then, you have to set an instance of the above formatter to the FormatterProvider property of the HourInterval: