ywana-core8 0.1.73 → 0.1.74
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.
- package/dist/index.cjs +12 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +12 -4
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +12 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/table.js +5 -4
package/package.json
CHANGED
package/src/html/table.js
CHANGED
@@ -46,10 +46,6 @@ export const DataTable = (props) => {
|
|
46
46
|
b = Number(b);
|
47
47
|
}
|
48
48
|
|
49
|
-
if (a === b) { // If the values are the same, do not switch positions.
|
50
|
-
return 0;
|
51
|
-
}
|
52
|
-
|
53
49
|
// If b > a, multiply by -1 to get the reverse direction.
|
54
50
|
return a > b ? direction : -1 * direction;
|
55
51
|
};
|
@@ -244,6 +240,11 @@ const DataTableCell = ({ index, row, column, cell, editable }) => {
|
|
244
240
|
case "String": return <StringCellViewer id={id} value={cell} format={format} options={options} action={action} />
|
245
241
|
case "Number": return <NumberCellViewer id={id} value={cell} format={format} maxDecimals={maxDecimals} />
|
246
242
|
case "Image": return <img src={cell} />
|
243
|
+
case "DATETIME":
|
244
|
+
const locale = window.navigator.userLanguage || window.navigator.language;
|
245
|
+
let date = new Date(cell)
|
246
|
+
date.setMinutes(date.getMinutes() + date.getTimezoneOffset() + 1)
|
247
|
+
return <span>{date.toLocaleString(locale, { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric' })}</span>
|
247
248
|
default: return cell
|
248
249
|
}
|
249
250
|
}
|