in public/js/components/AtomEdit/CustomEditors/TimelineFields/TimelineItem.js [88:150]
render() {
const value = this.props.fieldValue || {
title: ' ',
date: Date.now(),
body: ' ',
dateFormat: 'day-month-year',
};
return (
<div className="form__field form__field--nested">
<ManagedForm
data={value}
updateData={this.updateItem}
onFormErrorsUpdate={this.props.onFormErrorsUpdate}
formName="timelineEditor"
>
<ManagedField fieldLocation="date" name="Date" isRequired={true}>
<FormFieldDateTextInput />
</ManagedField>
<FormFieldCheckbox
fieldName="ranged-date"
fieldLabel="Want a date range?"
fieldValue={this.state.dateRangeRequired}
onUpdateField={this.updateDateRange.bind(this)}
/>
<div className={!this.state.dateRangeRequired ? 'form__row' : ' '} />
<ManagedField isRequired={false} fieldLocation="toDate">
{this.renderDateRangeSelector()}
</ManagedField>
<ManagedField
fieldLocation="dateFormat"
name="Date Format"
isRequired={false}
>
<FormFieldSelectBox
fieldLabel="Date Format"
selectValues={this.dateFormats}
optionsAsObject={false}
/>
{/*<FormFieldRadioButtons*/}
{/*fieldLabel="Date Format"*/}
{/*selectValues={this.dateFormats.map(dateFormat => dateFormat.value)}*/}
{/*selectLabels={this.dateFormats.map(dateFormat => dateFormat.name)}*/}
{/*fieldValue={this.getDateFormat() ? this.getDateFormat().value : 'day-month-year'}*/}
{/*fieldCaption="will default to calendar date if left blank"/>*/}
</ManagedField>
<ManagedField fieldLocation="title" name="Title" isRequired={true}>
<FormFieldTextInput />
</ManagedField>
<ManagedField fieldLocation="body" name="Body">
<FormFieldsRichTextEditor
showWordCount={true}
showToolbar={true}
suggestedLength={wordLimits.default}
tooLongMsg={tooLongMsg(wordLimits.default)}
/>
</ManagedField>
</ManagedForm>
<ShowErrors errors={this.props.fieldErrors} />
</div>
);
}