Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@ixnode/simple-clock
Advanced tools
A simple, customizable, and responsive clock component for React.
npm install @ixnode/simple-clock
or
yarn add @ixnode/simple-clock
import React from 'react';
import { Clock } from '@ixnode/simple-clock';
import '@ixnode/simple-clock/dist/styles.css';
const App = () => (
<Clock size="large" color="blue" showDate={true} showBorder={true} showTimeZone={true} />
);
export default App;
import React from 'react';
import { Clock } from '@ixnode/simple-clock';
import '@ixnode/simple-clock/dist/styles.css';
const App = () => (
<Clock color={'default'} size={'small'} isAnalog={true} timeZone={"Europe/Berlin"} locale={"de-DE"} />
);
export default App;
Prop | Type | Default | Description |
---|---|---|---|
color | 'default'|'red'|'green'|'blue' | 'default' | Sets the color of the clock. |
size | 'small'|'medium'|'large' | 'medium' | Sets the size of the clock. |
showBorder | boolean | false | Whether to show a border around the clock. |
use24HourFormat | boolean | true | Use 24-hour format (true) or AM/PM (false). |
showTenths | boolean | false | Show tenth of a second? |
isAnalog | boolean | false | Show an analog clock? |
showDate | boolean | false | Show date? |
showTimeZone | boolean | false | Should a timezone be displayed? |
timeZoneType | 'short'|'long' | 'short' | Which type of timezone should be displayed? |
locale | string | 'en-US' | Which locale should be displayed? |
timeZone | string | 'UTC' | Which time zone should be displayed? |
locale
)timeZone
is used with the Intl.DateTimeFormat
API:
Locale | Description |
---|---|
en-US | English (United States) |
en-GB | English (United Kingdom) |
de-DE | German (Germany) |
es-ES | Spanish (Spain) |
fr-FR | French (France) |
it-IT | Italian (Italy) |
nl-NL | Dutch (Netherlands) |
pl-PL | Polish (Poland) |
pt-BR | Portuguese (Brazil) |
ru-RU | Russian (Russia) |
sv-SE | Swedish (Sweden) |
zh-CN | Chinese (Simplified, China) |
zh-TW | Chinese (Traditional, Taiwan) |
timeZone
)timeZone
is used with the Intl.DateTimeFormat
API:
These strings are based on the IANA Time Zone Database, which defines time zones used worldwide:
Time Zone | Description |
---|---|
UTC | Coordinated Universal Time |
America/New_York | Eastern Standard Time (EST) |
Europe/Berlin | Central European Time (CET) |
Asia/Tokyo | Japan Standard Time (JST) |
Australia/Sydney | Australian Eastern Time (AET) |
Africa/Cairo | East Africa Time (EAT) |
Pacific/Auckland | New Zealand Standard Time (NZST) |
These formats use the offset from UTC in hours and minutes. Examples:
Time Zone | Description |
---|---|
GMT | Greenwich Mean Time |
+02:00 | Two hours ahead of UTC |
-05:00 | Five hours behind UTC |
Note: These are not supported by the Intl
API and are not standardized. However, many abbreviations are commonly used in practice, such as:
Abbreviation | Description |
---|---|
PST | Pacific Standard Time (UTC-8) |
CET | Central European Time (UTC+1) |
IST | Indian Standard Time (UTC+5:30) |
To build the project locally:
yarn build
View and develop components in isolation:
yarn storybook
Open: http://localhost:6006/
yarn build
node dist/index.js
Update the version in the package.json, e.g., from 1.0.0 to 1.0.1, to create a new release:
npm version patch
Alternatively:
npm version minor
for new features.npm version major
for breaking changes.npm publish --access public
Check the package on npm: https://www.npmjs.com/package/@ixnode/simple-clock.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Feel free to submit issues or pull requests to improve this project.
Special thanks to the open-source community for providing amazing tools like React, TypeScript, and Storybook.
[1.0.2] - 2024-12-21
FAQs
A simple, updating clock component for React.
The npm package @ixnode/simple-clock receives a total of 28 weekly downloads. As such, @ixnode/simple-clock popularity was classified as not popular.
We found that @ixnode/simple-clock demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.