aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-01-20 15:42:58 -0800
committerAnton Tananaev <anton@traccar.org>2023-01-20 15:42:58 -0800
commit1ec8590202e744d22711810f33150fd826149073 (patch)
tree74253c21bd15913e0fe9119d508840a1db3c57c5 /modern/src/settings
parent4daadef69571772b6872a1356289bcab6b46930e (diff)
downloadtrackermap-web-1ec8590202e744d22711810f33150fd826149073.tar.gz
trackermap-web-1ec8590202e744d22711810f33150fd826149073.tar.bz2
trackermap-web-1ec8590202e744d22711810f33150fd826149073.zip
List device expiration (fix #1075)
Diffstat (limited to 'modern/src/settings')
-rw-r--r--modern/src/settings/DevicesPage.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/modern/src/settings/DevicesPage.js b/modern/src/settings/DevicesPage.js
index 07109aee..0ad76106 100644
--- a/modern/src/settings/DevicesPage.js
+++ b/modern/src/settings/DevicesPage.js
@@ -11,6 +11,8 @@ import CollectionFab from './components/CollectionFab';
import CollectionActions from './components/CollectionActions';
import TableShimmer from '../common/components/TableShimmer';
import SearchHeader, { filterByKeyword } from './components/SearchHeader';
+import { usePreference } from '../common/util/preferences';
+import { formatTime } from '../common/util/formatter';
const useStyles = makeStyles((theme) => ({
columnAction: {
@@ -23,6 +25,8 @@ const DevicesPage = () => {
const classes = useStyles();
const t = useTranslation();
+ const hours12 = usePreference('twelveHourFormat');
+
const [timestamp, setTimestamp] = useState(Date.now());
const [items, setItems] = useState([]);
const [searchKeyword, setSearchKeyword] = useState('');
@@ -53,6 +57,7 @@ const DevicesPage = () => {
<TableCell>{t('sharedPhone')}</TableCell>
<TableCell>{t('deviceModel')}</TableCell>
<TableCell>{t('deviceContact')}</TableCell>
+ <TableCell>{t('userExpirationTime')}</TableCell>
<TableCell className={classes.columnAction} />
</TableRow>
</TableHead>
@@ -64,6 +69,7 @@ const DevicesPage = () => {
<TableCell>{item.phone}</TableCell>
<TableCell>{item.model}</TableCell>
<TableCell>{item.contact}</TableCell>
+ <TableCell>{formatTime(item.expirationTime, 'date', hours12)}</TableCell>
<TableCell className={classes.columnAction} padding="none">
<CollectionActions itemId={item.id} editPath="/settings/device" endpoint="devices" setTimestamp={setTimestamp} />
</TableCell>