
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
react-relative-time
Advanced tools
React Component for rendering relative dates as <time> HTML5 elements
React Component for rendering relative dates as <time>
HTML5 element and preserving machine readable format in datetime
attribute.
Does not depend on moment.js
This module was inspired by a few awesome open source projects.
npm install react-relative-time
import React from 'react'
import RelativeTime from 'react-relative-time'
class MyComponent extends React.Component {
render() {
let now = new Date()
let wasDate = new Date("Thu Jul 18 2013 15:48:59 GMT+0400")
return (
<div>
<p><RelativeTime value={1492630940000} titleFormat="YYYY/MM/DD HH:mm" /></p>
<p><RelativeTime value="1970-01-01T00:00:00Z" titleformat="iso8601" /></p>
<p><RelativeTime value={new Date(2017, 3, 19, 22, 33, 44, 666)} /></p>
</div>
)
}
}
value
The input date and time, which will be displayed in relative terms to the present date and time.
Supported types:
Date object
new Date(2017, 3, 19, 22, 33, 44, 666)
number - UNIX timestamp in milliseconds
1492630940000
string - ISO-8601 date string
1970-01-01T00:00:00Z
titleFormat
The specifier for the date and time format to be shown in the title
attribute.
Default: iso8601
.
Supported formats:
iso8601
- ISO-8601 date stringYYYY/MM/DD HH:mm
Supported number placeholders:
M = month
D = date
H = hour
m = minute
s = second
FAQs
React Component for rendering relative dates as <time> HTML5 elements
The npm package react-relative-time receives a total of 16,273 weekly downloads. As such, react-relative-time popularity was classified as popular.
We found that react-relative-time demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.