import 'moment-timezone';
import { CompactCard, FormLabel } from '@automattic/components';
import { localize } from 'i18n-calypso';
import PropTypes from 'prop-types';
import { Component } from 'react';
import Site from 'calypso/blocks/site';
import FormattedHeader from 'calypso/components/formatted-header';
import FormButton from 'calypso/components/forms/form-button';
import FormFieldset from 'calypso/components/forms/form-fieldset';
import FormSettingExplanation from 'calypso/components/forms/form-setting-explanation';
import FormTextInput from 'calypso/components/forms/form-text-input';
import { withLocalizedMoment } from 'calypso/components/localized-moment';
import Confirmation from './confirmation';
class AppointmentInfo extends Component {
static propTypes = {
appointment: PropTypes.object.isRequired,
};
renderAppointmentDetails() {
const {
appointment: { beginTimestamp, endTimestamp, id, scheduleId, meta },
translate,
moment,
site,
} = this.props;
const conferenceLink = meta.conference_link || '';
const guessedTimezone = moment.tz.guess();
const userTimezoneAbbr = moment.tz( guessedTimezone ).format( 'z' );
// Moment timezone does not display the abbreviation for some countries(e.g. for Dubai, it shows timezone abbr as +04 ).
// Don't display the timezone for such countries.
const shouldDisplayTzAbbr = /[a-zA-Z]/g.test( userTimezoneAbbr );
const momentDisplayFormat = shouldDisplayTzAbbr ? 'LT z' : 'LT';
const isAllowedToChangeAppointment = meta.canChangeAppointment;
return (
<>