سؤال

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!

هل كانت مفيدة؟

المحلول

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"
});

نصائح أخرى

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

var timeline = new TimelineView("timeline", "EmployeeId");
timeline.X_Date = "%h:%i %A";
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top