gpt4 book ai didi

javascript - 完整日历可自定义标题

转载 作者:行者123 更新时间:2023-11-30 10:57:04 25 4
gpt4 key购买 nike

我在代码中使用了以下属性,如下所示:-

columnHeaderFormat: {
weekday: 'short', month: 'numeric', day: 'numeric', omitCommas: true
}

有点像这样 Done using attribute

现在,因为我想在当前月份的第 1 周、第 2 周等实现 header 自定义,例如周一到周日,下面是一个示例

Image example

因为我想保留左侧的资源,如图所示,也不应将其删除。

最佳答案

您可以相当直接地实现这一目标。

然而,重要的是要认识到 columnHeaderFormat 在时间轴 View 中没有用,因为水平标题栏上的内容不是列(代表天,就像在 TimeGrid View 中一样),而是实际上是时隙(在 TimeGrid View 中通常位于垂直左侧)。

因此您需要使用slotLabelFormat 设置来调整外观。要在标题中获得两个水平条(根据您的示例屏幕截图),您可以在格式选项中设置两个单独的设置:

slotLabelFormat: [
{ week: "short" }, // top level of text
{ weekday: "short" } // lower level of text
],

工作演示:https://codepen.io/ADyson82/pen/ZEYaXmJ?&editable=true&editors=001

相关文档:

关于javascript - 完整日历可自定义标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59578909/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com