xpyjs / gantt

An easy-to-use Gantt component. 持续更新,中文文档

Home Page:https://docs.xiaopangying.com/gantt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG]甘特图按月份展示时slider展示位置不正确

GeassAthena opened this issue · comments

Describe the bug
如图所示起始日期为4月28日,但是展示时出现在5月的位置,选择按天和按周展示时所属月份是正常显示的

Expected behavior
在正确的月份显示

Screenshots
image

Versions

  • Version 2.0.4
  • Browser edge

此外,表格头部的日、周展示格式是否可更改或者配置,2.04版本日的显示是纯数字,但是2.1.0版本变成类似于 1th 的展示形式,尝试过dayjs国际化,但是没有发生变化
image

日期位置问题,给我复现代码

表头内容问题,你可以看一下当前是什么语言:

dayjs.locale('zh-cn');

console.log('main', dayjs.locale());

日期位置问题,给我复现代码

表头内容问题,你可以看一下当前是什么语言:

dayjs.locale('zh-cn');

console.log('main', dayjs.locale());

关于表头内容问题

image

image

版本号 => "@xpyjs/gantt": "^2.1.0"

image
我也一样 但是demo确实没问题

日期位置问题,给我复现代码

表头内容问题,你可以看一下当前是什么语言:

dayjs.locale('zh-cn');

console.log('main', dayjs.locale());

关于日期位置

我将demo代码复制到项目中执行效果如下:

按月展示:image

按天展示image

甘特图配置和demo中的一致,使用的数据为

const ganttData = reactive([{
      index: '2',
      type: 1,
      startDate: new Date('2022-02-19'),
      endDate: new Date('2022-07-24'),
      children: [
        {
          index: '20000001',
          startDate: new Date('2022-03-09'),
          endDate: new Date('2022-07-17'),
          children: [
            {
              index: '2000000101',
              startDate: new Date('2022-03-09'),
              endDate: new Date('2022-07-17'),
              children: [],
            },
            {
              index: '2000000102',
              startDate: new Date('2022-03-09'),
              endDate: new Date('2022-06-19'),
              children: [],
            },
          ],
        },
      ],
    },
]);