Convert Card last_seen_at Date to last_seen DateTime
This commit is contained in:
@@ -103,8 +103,16 @@ function AdminCardDetail(props) {
|
||||
</Form.Group>
|
||||
</Form.Group>
|
||||
|
||||
Notes: {input.notes || 'None'},
|
||||
Last Seen: {input.last_seen_at || 'Unknown'}
|
||||
Notes: {input.notes || 'None'}<br />
|
||||
Last Seen:{' '}
|
||||
{input.last_seen ?
|
||||
input.last_seen > '2021-11-14T02:01:35.415685Z' ?
|
||||
moment.utc(input.last_seen).tz('America/Edmonton').format('lll')
|
||||
:
|
||||
moment.utc(input.last_seen).tz('America/Edmonton').format('ll')
|
||||
:
|
||||
'Unknown'
|
||||
}
|
||||
</Form>
|
||||
</Segment>
|
||||
:
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { BrowserRouter as Router, Switch, Route, Link, useParams } from 'react-router-dom';
|
||||
import './light.css';
|
||||
import moment from 'moment-timezone';
|
||||
import { Button, Container, Divider, Dropdown, Form, Grid, Header, Icon, Image, Menu, Message, Segment, Table } from 'semantic-ui-react';
|
||||
import { BasicTable, requester, staticUrl } from './utils.js';
|
||||
import { NotFound, PleaseLogin } from './Misc.js';
|
||||
@@ -45,7 +46,16 @@ export function Cards(props) {
|
||||
<Table.Row key={x.id}>
|
||||
<Table.Cell>{x.card_number}</Table.Cell>
|
||||
<Table.Cell>{x.notes}</Table.Cell>
|
||||
<Table.Cell>{x.last_seen_at}</Table.Cell>
|
||||
<Table.Cell>
|
||||
{x.last_seen ?
|
||||
x.last_seen > '2021-11-14T02:01:35.415685Z' ?
|
||||
moment.utc(x.last_seen).tz('America/Edmonton').format('lll')
|
||||
:
|
||||
moment.utc(x.last_seen).tz('America/Edmonton').format('ll')
|
||||
:
|
||||
'Unknown'
|
||||
}
|
||||
</Table.Cell>
|
||||
<Table.Cell>{cardStatus(x)}</Table.Cell>
|
||||
</Table.Row>
|
||||
)}
|
||||
@@ -64,7 +74,16 @@ export function Cards(props) {
|
||||
</Table.Row>
|
||||
<Table.Row>
|
||||
<Table.Cell>Last Seen:</Table.Cell>
|
||||
<Table.Cell>{card.last_seen_at}</Table.Cell>
|
||||
<Table.Cell>
|
||||
{card.last_seen ?
|
||||
card.last_seen > '2021-11-14T02:01:35.415685Z' ?
|
||||
moment.utc(card.last_seen).tz('America/Edmonton').format('lll')
|
||||
:
|
||||
moment.utc(card.last_seen).tz('America/Edmonton').format('ll')
|
||||
:
|
||||
'Unknown'
|
||||
}
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
<Table.Row>
|
||||
<Table.Cell>Active:</Table.Cell>
|
||||
|
@@ -14,7 +14,7 @@ function MemberInfo(props) {
|
||||
const member = user.member;
|
||||
|
||||
const lastTrans = user.transactions && user.transactions.slice(0,3);
|
||||
const lastCard = user.cards && user.cards.sort((a, b) => a.last_seen_at < b.last_seen_at)[0];
|
||||
const lastCard = user.cards && user.cards.sort((a, b) => a.last_seen < b.last_seen)[0];
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
Reference in New Issue
Block a user