aboutsummaryrefslogtreecommitdiff
path: root/modern
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2023-05-31 21:50:25 -0600
committerIván Ávalos <avalos@disroot.org>2023-05-31 21:50:25 -0600
commit6ce874d5ecc29051cf5eadded822d7a0e5930af1 (patch)
treec5d3ceb6d05adae93f6b64f27cc76ac650c00b63 /modern
parenta7b5b305878ae300d9d2426303af506d750d2139 (diff)
downloadetbsa-traccar-web-6ce874d5ecc29051cf5eadded822d7a0e5930af1.tar.gz
etbsa-traccar-web-6ce874d5ecc29051cf5eadded822d7a0e5930af1.tar.bz2
etbsa-traccar-web-6ce874d5ecc29051cf5eadded822d7a0e5930af1.zip
Se arregla horómetro para Suntech nuevos
Diffstat (limited to 'modern')
-rw-r--r--modern/src/DevicesList.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/modern/src/DevicesList.js b/modern/src/DevicesList.js
index af463ab..fb89260 100644
--- a/modern/src/DevicesList.js
+++ b/modern/src/DevicesList.js
@@ -104,6 +104,19 @@ const DeviceRow = ({ data, index, style }) => {
}
};
+ const getPositionHours = (pos, it) => {
+ if (it.category
+ && (it.category === 'backhoe' || it.category === 'tractor')
+ && pos) {
+ if (pos.attributes.io16) {
+ return formatHours(parseInt(position.attributes.io16) * 60 * 1000, t);
+ } else if (pos.attributes.hours) {
+ return formatHours(position.attributes.hours, t);
+ }
+ }
+ return null;
+ }
+
return (
<div style={style}>
<ListItem button key={item.id} className={classes.listItem} onClick={() => {
@@ -144,11 +157,8 @@ const DeviceRow = ({ data, index, style }) => {
{/* Datetime */}
<CalendarTodayIcon fontSize="inherit" /> {formatPosition(position, 'fixTime', t)}
{/* Hours */}
- {item.category
- && (item.category.toLowerCase() === 'backhoe' || item.category.toLowerCase() === 'tractor' )
- && position.attributes.hours
- && position.attributes.hours > 1
- && ` (${formatHours(position.attributes.hours, t)})`}<br />
+ {getPositionHours(position, item) && ` (${getPositionHours(position, item)})`}
+ <br />
{/* Address */}
{position.address && (
<>