mirror of
https://github.com/stronk-dev/LivepeerEvents.git
synced 2025-07-05 10:45:10 +02:00
Display block time in local time and timezone
This commit is contained in:
parent
3480796c09
commit
d1033e6419
@ -1,20 +1,26 @@
|
||||
import React from "react";
|
||||
import React from 'react';
|
||||
|
||||
const Block = (obj) => {
|
||||
const thisEpoch = obj.time;
|
||||
var dateObj = new Date(0);
|
||||
dateObj.setUTCSeconds(thisEpoch);
|
||||
const [thisDate, thisTime] = dateObj.toISOString().split('T');
|
||||
const thisLocalDate = dateObj.toLocaleString();
|
||||
const thisOffset = (-dateObj.getTimezoneOffset() / 60);
|
||||
return (
|
||||
<div className="rowAlignLeft" style={{ margin: 0, marginTop: '1em', width: '100%'}}>
|
||||
<div className="rowAlignLeft" style={{ margin: 0, marginTop: '1em', width: '100%' }}>
|
||||
<a className="selectOrch" style={{ cursor: 'alias', margin: 0 }} target="_blank" rel="noopener noreferrer" href={obj.url}>
|
||||
<img alt="" src="arb.svg" width="20em" height="20em" />
|
||||
</a>
|
||||
<a className="selectOrch" style={{ cursor: 'alias', margin: 0 }} target="_blank" rel="noopener noreferrer" href={"https://arbiscan.io/block/" + obj.block}>
|
||||
<h3 style={{ padding: '0.2em', cursor: 'alias' }}>🔗</h3>
|
||||
</a>
|
||||
<span className="rowAlignRight darkText mobileSmallerFont" style={{margin: 0}}>
|
||||
UTC 📅{thisDate} - {thisTime.split('.')[0]}
|
||||
<span className="rowAlignRight darkText mobileSmallerFont" style={{ margin: 0 }}>
|
||||
<p style={{ overflowWrap: 'break-word' }}>
|
||||
📅 {thisLocalDate}
|
||||
</p>
|
||||
<p className='darkTextSmoll' style={{ overflowWrap: 'break-word' }}>
|
||||
({thisOffset > 0 ? "+" : ""}{thisOffset})
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
|
@ -2,8 +2,6 @@ import React, { useState, useEffect } from 'react';
|
||||
import Stat from "./statViewer";
|
||||
import Address from "./OrchAddressViewer";
|
||||
import { useSelector } from 'react-redux';
|
||||
import { Text } from "@mantine/core";
|
||||
import ScrollContainer from "react-indiana-drag-scroll";
|
||||
import { Popover } from '@mantine/core';
|
||||
|
||||
function updateClipboard(newClip) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user