最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - fullcalendar how to remove 00 uhr in header? - Stack Overflow

programmeradmin3浏览0评论

how can I remove the 00 Uhr everytime in the header ?

code:

      <FullCalendar
        ref={ref}
        resources={res}
        viewClassNames='zd'
        scrollTime={milliseconds - 86400000}
        // @ts-ignore
        events={query}
        schedulerLicenseKey="0487410008-fcs-16832974662" 
        plugins={[ resourceTimelinePlugin, interactionPlugin, dayGrid, scrollGrid ]}
        initialView='resourceTimelineYear'
        allDayContent={(el) => console.log(el)}
        views={{
          resourceTimelineYear: {
            duration: {
              years: 2
            },
            slotDuration: { hours: 24 },
          },
          
        }}
        locale='de'
 />

if I remove slotduration hours 24 then it shows only the months

how can I remove the 00 Uhr everytime in the header ?

code:

      <FullCalendar
        ref={ref}
        resources={res}
        viewClassNames='zd'
        scrollTime={milliseconds - 86400000}
        // @ts-ignore
        events={query}
        schedulerLicenseKey="0487410008-fcs-16832974662" 
        plugins={[ resourceTimelinePlugin, interactionPlugin, dayGrid, scrollGrid ]}
        initialView='resourceTimelineYear'
        allDayContent={(el) => console.log(el)}
        views={{
          resourceTimelineYear: {
            duration: {
              years: 2
            },
            slotDuration: { hours: 24 },
          },
          
        }}
        locale='de'
 />

if I remove slotduration hours 24 then it shows only the months

Share Improve this question asked Mar 14 at 23:12 oemer okoemer ok 611 silver badge5 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

The time slots including midnight values due to slotDuration: { hours: 24 } and since you are viewing it in day slots those values are showing in the header. You can either change the slotDuration: { day: 1 } or change the slotLabelContent like below.

To override the slotLabelContent:

  const slotLabelContent = (arg) => {
    return `${arg.text}`;
  };
<FullCalendar
...
slotLabelContent={slotLabelContent}
...
/>

Note: I just print the text of the arg, you can use whatever logic there.

发布评论

评论列表(0)

  1. 暂无评论