Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@capaj/react-select-timezone
Advanced tools
Readme
A simple component wrapping React-Select and Moment.Timezone to make a timezone picker.
Forked from vinhnglx/react-timezone-select
$ npm install @capaj/react-select-timezone
import React from 'react'
import ReactDOM from 'react-dom'
import PropTypes from 'prop-types'
import SelectTimezone, { getTimezoneProps } from 'react-select-timezone'
const App = () => {
return (
<div>
<SelectTimezone
value={momentTimezone.tz.guess()} // the default, so you can omit if you don't need other value
isClearable // allows user to have null value in this select
guess // this will fill the input with user's timezone guessed by moment. A "value" prop has always bigger priority than guessed TZ
onChange={(val) => {
console.log(val) // like "Europe/London"
// if you need to get offset you can use
const timezoneProps = getTimezoneProps(val)
console.log(timezoneProps.time) // like "-2.00"
console.log(timezoneProps.label) // like "(GMT+02:00) Europe/Prague"
console.log(timezoneProps.offset) // like -120
}}
/>
</div>
)
}
App.propTypes = {
name: PropTypes.string
}
export default App
if you just need to display a timezone in the same format, do import {formatTimezone} from @capaj/react-select-timezone
and use that. It will format the Europe/London
into (GMT+01:00) Europe/London
If you prefer virtualized list, import makeVirtualMenuListComponent
and use it like show in the showcase.
FAQs
React select timezone
The npm package @capaj/react-select-timezone receives a total of 172 weekly downloads. As such, @capaj/react-select-timezone popularity was classified as not popular.
We found that @capaj/react-select-timezone demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.