@ssfm/gantt-task-react 0.6.17 → 0.6.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3770,34 +3770,39 @@ const Calendar = ({
3770
3770
  const topValues2 = [];
3771
3771
  const bottomValues2 = [];
3772
3772
  const topDefaultHeight = headerHeight * 0.5;
3773
+ const quarterTextOffset = columnWidth * 0.5;
3773
3774
  for (let i2 = startColumnIndex; i2 <= endColumnIndex; i2++) {
3774
3775
  const date = getDate(i2);
3775
- const quarter = "Q" + Math.ceil((date.getMonth() + 1) / 3);
3776
+ const quarterIndex = Math.ceil((date.getMonth() + 1) / 3);
3777
+ const quarterText = "Q" + quarterIndex;
3778
+ const quarterXPosition = additionalLeftSpace + columnWidth * i2;
3776
3779
  bottomValues2.push(
3777
3780
  /* @__PURE__ */ jsx(
3778
3781
  "text",
3779
3782
  {
3780
3783
  y: headerHeight * 0.8,
3781
- x: additionalLeftSpace + columnWidth * i2 + columnWidth * 0.5,
3784
+ x: quarterXPosition + quarterTextOffset,
3782
3785
  className: styles$a.calendarBottomText,
3783
3786
  style: { fill: colors.barLabelColor },
3784
- children: quarter
3787
+ children: quarterText
3785
3788
  },
3786
- `${quarter}-${date.getFullYear()}`
3789
+ `${quarterText}-${date.getFullYear()}`
3787
3790
  )
3788
3791
  );
3792
+ if (quarterIndex > 1) {
3793
+ continue;
3794
+ }
3789
3795
  if (!isUnknownDates && (i2 === startColumnIndex || date.getFullYear() !== getDate(i2 - 1).getFullYear())) {
3790
3796
  const topValue = date.getFullYear().toString();
3791
- const startQuarter = Math.floor(i2 / 3) * 3;
3792
3797
  topValues2.push(
3793
3798
  /* @__PURE__ */ jsx(
3794
3799
  TopPartOfCalendar,
3795
3800
  {
3796
3801
  value: topValue,
3797
- x1Line: additionalLeftSpace + columnWidth * startQuarter,
3802
+ x1Line: quarterXPosition,
3798
3803
  y1Line: 0,
3799
3804
  y2Line: topDefaultHeight,
3800
- xText: additionalLeftSpace + columnWidth * (startQuarter + 1.5),
3805
+ xText: quarterXPosition + columnWidth * 2,
3801
3806
  yText: topDefaultHeight * 0.9,
3802
3807
  colors
3803
3808
  },
@@ -3783,34 +3783,39 @@
3783
3783
  const topValues2 = [];
3784
3784
  const bottomValues2 = [];
3785
3785
  const topDefaultHeight = headerHeight * 0.5;
3786
+ const quarterTextOffset = columnWidth * 0.5;
3786
3787
  for (let i = startColumnIndex; i <= endColumnIndex; i++) {
3787
3788
  const date = getDate(i);
3788
- const quarter = "Q" + Math.ceil((date.getMonth() + 1) / 3);
3789
+ const quarterIndex = Math.ceil((date.getMonth() + 1) / 3);
3790
+ const quarterText = "Q" + quarterIndex;
3791
+ const quarterXPosition = additionalLeftSpace + columnWidth * i;
3789
3792
  bottomValues2.push(
3790
3793
  /* @__PURE__ */ jsxRuntime.jsx(
3791
3794
  "text",
3792
3795
  {
3793
3796
  y: headerHeight * 0.8,
3794
- x: additionalLeftSpace + columnWidth * i + columnWidth * 0.5,
3797
+ x: quarterXPosition + quarterTextOffset,
3795
3798
  className: styles$a.calendarBottomText,
3796
3799
  style: { fill: colors.barLabelColor },
3797
- children: quarter
3800
+ children: quarterText
3798
3801
  },
3799
- `${quarter}-${date.getFullYear()}`
3802
+ `${quarterText}-${date.getFullYear()}`
3800
3803
  )
3801
3804
  );
3805
+ if (quarterIndex > 1) {
3806
+ continue;
3807
+ }
3802
3808
  if (!isUnknownDates && (i === startColumnIndex || date.getFullYear() !== getDate(i - 1).getFullYear())) {
3803
3809
  const topValue = date.getFullYear().toString();
3804
- const startQuarter = Math.floor(i / 3) * 3;
3805
3810
  topValues2.push(
3806
3811
  /* @__PURE__ */ jsxRuntime.jsx(
3807
3812
  TopPartOfCalendar,
3808
3813
  {
3809
3814
  value: topValue,
3810
- x1Line: additionalLeftSpace + columnWidth * startQuarter,
3815
+ x1Line: quarterXPosition,
3811
3816
  y1Line: 0,
3812
3817
  y2Line: topDefaultHeight,
3813
- xText: additionalLeftSpace + columnWidth * (startQuarter + 1.5),
3818
+ xText: quarterXPosition + columnWidth * 2,
3814
3819
  yText: topDefaultHeight * 0.9,
3815
3820
  colors
3816
3821
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssfm/gantt-task-react",
3
- "version": "0.6.17",
3
+ "version": "0.6.18",
4
4
  "description": "Interactive Gantt Chart for React with TypeScript",
5
5
  "author": "Dmitry Kostochko <dkostochko@users.noreply.github.com>",
6
6
  "homepage": "https://github.com/dkostochko/gantt-task-react/blob/main/README.md#gantt-task-react",