Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public render() {
const { timezone, targetDisplayFormat, disabled, showCustomTarget, showLocalTimezone } = this.state;
const options = (
<>
<h5>Props</h5>
import { CustomTimezonePickerTarget } from "./components";
export interface ITimezonePickerExampleState {
disabled: boolean;
showCustomTarget: boolean;
showLocalTimezone: boolean;
targetDisplayFormat: TimezoneDisplayFormat;
timezone: string;
}
export class TimezonePickerExample extends React.PureComponent {
public state: ITimezonePickerExampleState = {
disabled: false,
showCustomTarget: false,
showLocalTimezone: true,
targetDisplayFormat: TimezoneDisplayFormat.COMPOSITE,
timezone: "",
};
private handleDisabledChange = handleBooleanChange(disabled => this.setState({ disabled }));
private handleShowLocalChange = handleBooleanChange(showLocalTimezone => this.setState({ showLocalTimezone }));
private handleCustomChildChange = handleBooleanChange(showCustomTarget => this.setState({ showCustomTarget }));
private handleFormatChange = handleStringChange((targetDisplayFormat: TimezoneDisplayFormat) =>
this.setState({ targetDisplayFormat }),
);
public render() {
const { timezone, targetDisplayFormat, disabled, showCustomTarget, showLocalTimezone } = this.state;
const options = (
<>
<h5>Props</h5>
private getTooltipContent() {
const { timezone } = this.props;
if (timezone == null || timezone.length === 0) {
return "No selection";
}
const { abbreviation, offsetAsString } = getTimezoneMetadata(timezone);
return (
<span>
GMT {offsetAsString}
<span style="{{">{abbreviation ? ` (${abbreviation})` : ""}</span>
</span>
);
}
public render() {
const { timezone, targetDisplayFormat, disabled, showCustomTarget, showLocalTimezone } = this.state;
const options = (
<>
<h5>Props</h5>
public render() {
const { timezone, targetDisplayFormat, disabled, showCustomTarget, showLocalTimezone } = this.state;
const options = (
<>
<h5>Props</h5>
const { timezone, targetDisplayFormat, disabled, showCustomTarget, showLocalTimezone } = this.state;
const options = (
<>
<h5>Props</h5>