mig-schema-table 3.0.77 → 3.0.79

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.
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { SELECT_ALL_COLUMN_NAME } from "../constants";
4
4
  import { localeFormatInTimeZone, timeZone } from "../../inc/date";
5
- import { DEFAULT_DATE_FORMAT, DEFAULT_DATE_TIME_FORMAT, } from "../../inc/constant";
5
+ import { DEFAULT_DATE_TIME_FORMAT, } from "../../inc/constant";
6
6
  import { t } from "../../inc/string";
7
7
  function Td({ checkedIndexes, disabledCheckedIndexes, columnIndex, data, getRowClassName, getRowSelected, onCheckedIndexesChange, onRowClick, onRowDoubleClick, propConfig, propName, propSchema, rowHeight, rowIndex, sortedRenderData, style, }) {
8
8
  const onTdClick = React.useCallback((e) => {
@@ -34,7 +34,7 @@ function Td({ checkedIndexes, disabledCheckedIndexes, columnIndex, data, getRowC
34
34
  }
35
35
  let title = propName === SELECT_ALL_COLUMN_NAME ? null : row[propName];
36
36
  if ((propSchema === null || propSchema === void 0 ? void 0 : propSchema.format) &&
37
- propSchema.format.startsWith("date") &&
37
+ propSchema.format === "date-time" &&
38
38
  (propConfig === null || propConfig === void 0 ? void 0 : propConfig.showTimezones) !== false) {
39
39
  // @ts-ignore
40
40
  const dateString = data[row._index][propName];
@@ -43,9 +43,7 @@ function Td({ checkedIndexes, disabledCheckedIndexes, columnIndex, data, getRowC
43
43
  ? "Asia/Jakarta"
44
44
  : "Europe/Amsterdam";
45
45
  if (date) {
46
- title = `${localeFormatInTimeZone(date, alternativeTimeZone, propSchema.format === "date"
47
- ? DEFAULT_DATE_FORMAT
48
- : DEFAULT_DATE_TIME_FORMAT)} (${t(alternativeTimeZone)})`;
46
+ title = `${localeFormatInTimeZone(date, alternativeTimeZone, DEFAULT_DATE_TIME_FORMAT)} (${t(alternativeTimeZone)})`;
49
47
  }
50
48
  }
51
49
  const classNames = [
@@ -56,7 +56,7 @@ const Th = ({ columnFilterStatus, isAllChecked, isSortable, numberOfSelectedRows
56
56
  return propConfig.title;
57
57
  }
58
58
  if ((schema === null || schema === void 0 ? void 0 : schema.format) &&
59
- schema.format.startsWith("date") &&
59
+ schema.format === "date-time" &&
60
60
  (propConfig === null || propConfig === void 0 ? void 0 : propConfig.showTimezones) !== false) {
61
61
  return `${uncamel(propName)} (${t(timeZone)})`;
62
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mig-schema-table",
3
- "version": "3.0.77",
3
+ "version": "3.0.79",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/"