Use strftime since the UTC shenanigans don't work on IOS

parent d6b9dd53
......@@ -3,6 +3,7 @@ import Plot from 'react-plotly.js';
import { Data, Layout } from 'plotly.js';
import {auroraDataToGraphData} from '../../repositories/auroraData';
import MapStyle from './Map.module.scss';
import strftime from 'strftime';
interface iPlotState {
data?: Data[];
......@@ -95,10 +96,11 @@ export default class Map extends React.Component<{}, iPlotState> {
if (!data || !lastUpdateAt) return (<div>loading</div>)
const date = new Date(lastUpdateAt)
const hours = ('0' + date.getUTCHours()).slice(-2)
const minutes = ('0' + date.getUTCMinutes()).slice(-2)
const seconds = ('0' + date.getUTCSeconds()).slice(-2)
const time = strftime(
'%R:%S',
new Date(lastUpdateAt)
)
return (
<div className={MapStyle.mapContainer}>
......@@ -112,7 +114,7 @@ export default class Map extends React.Component<{}, iPlotState> {
<div className={MapStyle.timelet}>
Last update:
{ " " }
{ hours }:{ minutes }:{ seconds } UTC
{ time }
</div>
</div>
);
......
......@@ -2151,6 +2151,11 @@
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff"
integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw==
"@types/strftime@^0.9.2":
version "0.9.2"
resolved "https://registry.yarnpkg.com/@types/strftime/-/strftime-0.9.2.tgz#d74d791da15ef7ce8db89055af6752750e6784c9"
integrity sha1-1015HaFe986NuJBVr2dSdQ5nhMk=
"@types/tapable@*", "@types/tapable@^1.0.5":
version "1.0.6"
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.6.tgz#a9ca4b70a18b270ccb2bc0aaafefd1d486b7ea74"
......@@ -13175,6 +13180,11 @@ stream-shift@^1.0.0:
resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d"
integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==
strftime@0.9.2:
version "0.9.2"
resolved "https://registry.yarnpkg.com/strftime/-/strftime-0.9.2.tgz#bcca2861f29456d372aaf6a17811c8bc6f39f583"
integrity sha1-vMooYfKUVtNyqvaheBHIvG859YM=
strict-uri-encode@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment