角甘特 - 可能改变一天的头为'M,T,W,钍......“代替日期? [英] Angular-Gantt - possible to change day's header to 'M,T,W,Th ...' instead of date?
问题描述
我在调度的应用程序使用角Gantt.js模块的工作。
这是工作的罚款 - >除我想自定义标题显示M,T,W,钍,女......在当天viewscale列。目前,它会显示这样的演示版 - >
I am working on a scheduling app using the Angular-Gantt.js module. It is working fine --> except I'd like to customize the header to display "M,T,W,Th,F ..." for the columns in the day viewscale. Currently it displays like this demo version -->
https://www.angular-gantt.com/demo/
从该模块的文档中,有在创建之后的头和显示,并且不被创建的头时触发事件。然而,有关于如何编写一个插件的指南。我想知道如果任何人有解决这个问题,可以点我在正确的方向。
From the documentation for the module, there are events triggered after the headers are created and displayed and not when the header is being created. There is however a guide on how to write a plugin. I am wondering if anyone has tackled this issue and could point me in right direction.
非常感谢,
拉维
Many Thanks, Ravi
推荐答案
是的,这是可能的。只需添加HTML中的甘特指令标题的格式选项,并添加以下code到$ scope.option:
Yes, it is possible. Just add the headers-formats option on the gantt directive in the html and add the following code to your $scope.option:
In the html:
<div gantt
header-formats="options.headersFormats">
<div>
In the controller:
$scope.option: {
//other options
headersFormats: {
'year': 'YYYY',
'quarter': '[Q]Q YYYY',
month: 'MMMM YYYY',
week: function(column) {
return column.date.format('MMM D [-]') + column.endDate.format('[ ]MMM D');
},
day: 'ddd',
hour: 'H',
minute:'HH:mm'
},
}
在headersFormats的天属性设置为DDD将使其为星期一,星期二,星期三e.t.c。
Setting the 'day' property of the headersFormats to 'ddd' will make it to display the dates as 'Mon', 'Tue', 'Wed' e.t.c.
这篇关于角甘特 - 可能改变一天的头为'M,T,W,钍......“代替日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!