Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/quisido/absolute-timestamp
Renders an absolute timestamp in React
https://github.com/quisido/absolute-timestamp
Last synced: 17 days ago
JSON representation
Renders an absolute timestamp in React
- Host: GitHub
- URL: https://github.com/quisido/absolute-timestamp
- Owner: quisido
- License: mit
- Created: 2021-06-08T04:47:05.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-09T07:52:06.000Z (over 3 years ago)
- Last Synced: 2024-09-07T08:54:27.632Z (2 months ago)
- Language: TypeScript
- Size: 1.18 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Absolute timestamp
[![version](https://img.shields.io/npm/v/absolute-timestamp.svg)](https://www.npmjs.com/package/absolute-timestamp)
[![minzipped size](https://img.shields.io/bundlephobia/minzip/absolute-timestamp.svg)](https://www.npmjs.com/package/absolute-timestamp)
[![downloads](https://img.shields.io/npm/dt/absolute-timestamp.svg)](https://www.npmjs.com/package/absolute-timestamp)`AbsoluteTimestamp` is a React 17+ component for display Unix timestamps in
absolute format, e.g. `"December 31, 1969, 16:00 PST"`.## Install
- `npm install absolute-timestamp` or
- `yarn add absolute-timestamp`## Use
```javascript
import AbsoluteTimestamp from 'absolute-timestamp';function App() {
return {Date.now()};
}
```## Props
### `locales`
Type: `string | string[]` _optional_
Default: `'en-US'`
In order to get the format of the language used in the user interface of your
application, make sure to specify that language (and possibly some fallback
languages).See also:
[`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat)### `timeZone`
Type: `string` _optional_
Default: `undefined`
`timeZone` specifies the time zone to use. The only value guaranteed to be
recognized is `'UTC'`; the default is the runtime's default time zone.
Devices may also recognize the time zone names of the IANA time zone database,
such as `'Asia/Shanghai'`, `'Asia/Kolkata'`, or `'America/New_York'`.See also:
[`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat)## Contributing
- `yarn set version latest`
- `yarn`
- `yarn up * && yarn up @*/*`
- `yarn dlx @yarnpkg/pnpify --sdk vscode`