0

In Dhtmlx Scheduler Timeline View, how can I set the Hour header from military time(24hour) to 12-hour format?

Timeline View, Hour header

I have found some responses on their forum but this doesnt seem to work.

scheduler.config.hour_date = "%h:%i %A";

Any help would be appreciated. Thanks!

Jude Duran
  • 2,195
  • 2
  • 25
  • 41

2 Answers2

3

Hour format must be specified in timeline configuration object with x_date property. Here is the example:

scheduler.createTimelineView({
    name:   "timeline",
    x_unit: "hour",
    x_date: "%h:%i %A",
    x_step: 1,
    x_size: 24,
    y_unit: [
        {key:1, label:"James Smith"},
        {key:2, label:"John Williams"},
        {key:3, label:"David Miller"},
        {key:4, label:"Linda Brown"}
    ],
    y_property: "section_id",
    render:"bar"
});
Paul
  • 1,656
  • 11
  • 16
1

Here's the complete solution for MVC that I used.

var timeline = new TimelineView("timeline", "EmployeeId");
timeline.X_Date = "%h:%i %A";
Jude Duran
  • 2,195
  • 2
  • 25
  • 41