Call date utility function directly and not from private methods in every control
This commit is contained in:
parent
8a12f697f8
commit
b4a9d56c5f
|
@ -528,16 +528,6 @@ export class Event extends React.Component<IEventProps, IEventState> {
|
||||||
this.setState({ startDate: newDate });
|
this.setState({ startDate: newDate });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param date
|
|
||||||
* @memberof Event
|
|
||||||
*/
|
|
||||||
private formatDate(date: Date) {
|
|
||||||
return toLocaleShortDateString(date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {Date} newDate
|
* @param {Date} newDate
|
||||||
|
@ -669,7 +659,7 @@ export class Event extends React.Component<IEventProps, IEventState> {
|
||||||
value={this.state.startDate}
|
value={this.state.startDate}
|
||||||
label={strings.StartDateLabel}
|
label={strings.StartDateLabel}
|
||||||
onSelectDate={this.onSelectDateStart}
|
onSelectDate={this.onSelectDateStart}
|
||||||
formatDate={this.formatDate}
|
formatDate={toLocaleShortDateString}
|
||||||
disabled={this.state.userPermissions.hasPermissionAdd || this.state.userPermissions.hasPermissionEdit ? false : true}
|
disabled={this.state.userPermissions.hasPermissionAdd || this.state.userPermissions.hasPermissionEdit ? false : true}
|
||||||
hidden={this.state.showRecurrenceSeriesInfo}
|
hidden={this.state.showRecurrenceSeriesInfo}
|
||||||
/>
|
/>
|
||||||
|
@ -741,7 +731,7 @@ export class Event extends React.Component<IEventProps, IEventState> {
|
||||||
value={this.state.endDate}
|
value={this.state.endDate}
|
||||||
label={strings.EndDateLabel}
|
label={strings.EndDateLabel}
|
||||||
onSelectDate={this.onSelectDateEnd}
|
onSelectDate={this.onSelectDateEnd}
|
||||||
formatDate={this.formatDate}
|
formatDate={toLocaleShortDateString}
|
||||||
disabled={this.state.userPermissions.hasPermissionAdd || this.state.userPermissions.hasPermissionEdit ? false : true}
|
disabled={this.state.userPermissions.hasPermissionAdd || this.state.userPermissions.hasPermissionEdit ? false : true}
|
||||||
hidden={this.state.showRecurrenceSeriesInfo}
|
hidden={this.state.showRecurrenceSeriesInfo}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -86,16 +86,6 @@ export class EventRecurrenceInfoDaily extends React.Component<IEventRecurrenceIn
|
||||||
this.applyRecurrence();
|
this.applyRecurrence();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param date
|
|
||||||
* @memberof EventRecurrenceInfoDaily
|
|
||||||
*/
|
|
||||||
private formatDate(date: Date) {
|
|
||||||
return toLocaleShortDateString(date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
@ -353,7 +343,7 @@ export class EventRecurrenceInfoDaily extends React.Component<IEventRecurrenceIn
|
||||||
label={strings.StartDateLabel}
|
label={strings.StartDateLabel}
|
||||||
value={this.state.startDate}
|
value={this.state.startDate}
|
||||||
onSelectDate={this.onStartDateChange}
|
onSelectDate={this.onStartDateChange}
|
||||||
formatDate={this.formatDate}
|
formatDate={toLocaleShortDateString}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -380,7 +370,7 @@ export class EventRecurrenceInfoDaily extends React.Component<IEventRecurrenceIn
|
||||||
ariaLabel="Select a date"
|
ariaLabel="Select a date"
|
||||||
style={{ display: 'inline-block', verticalAlign: 'top', paddingLeft: '22px', }}
|
style={{ display: 'inline-block', verticalAlign: 'top', paddingLeft: '22px', }}
|
||||||
onSelectDate={this.onEndDateChange}
|
onSelectDate={this.onEndDateChange}
|
||||||
formatDate={this.formatDate}
|
formatDate={toLocaleShortDateString}
|
||||||
value={this.state.endDate}
|
value={this.state.endDate}
|
||||||
disabled={this.state.disableEndDate}
|
disabled={this.state.disableEndDate}
|
||||||
|
|
||||||
|
|
|
@ -112,15 +112,6 @@ export class EventRecurrenceInfoMonthly extends React.Component<IEventRecurrence
|
||||||
this.applyRecurrence();
|
this.applyRecurrence();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param date
|
|
||||||
* @memberof EventRecurrenceInfoMonthly
|
|
||||||
*/
|
|
||||||
private formatDate(date: Date) : string {
|
|
||||||
return toLocaleShortDateString(date);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
@ -590,7 +581,7 @@ export class EventRecurrenceInfoMonthly extends React.Component<IEventRecurrence
|
||||||
label={strings.StartDateLabel}
|
label={strings.StartDateLabel}
|
||||||
value={this.state.startDate}
|
value={this.state.startDate}
|
||||||
onSelectDate={this.onStartDateChange}
|
onSelectDate={this.onStartDateChange}
|
||||||
formatDate= {this.formatDate}
|
formatDate= {toLocaleShortDateString}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -617,7 +608,7 @@ export class EventRecurrenceInfoMonthly extends React.Component<IEventRecurrence
|
||||||
ariaLabel={strings.StartDatePlaceHolder}
|
ariaLabel={strings.StartDatePlaceHolder}
|
||||||
style={{ display: 'inline-block', verticalAlign: 'top', paddingLeft: '22px', }}
|
style={{ display: 'inline-block', verticalAlign: 'top', paddingLeft: '22px', }}
|
||||||
onSelectDate={this.onEndDateChange}
|
onSelectDate={this.onEndDateChange}
|
||||||
formatDate={this.formatDate}
|
formatDate={toLocaleShortDateString}
|
||||||
value={this.state.endDate}
|
value={this.state.endDate}
|
||||||
disabled={this.state.disableEndDate}
|
disabled={this.state.disableEndDate}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -101,17 +101,6 @@ export class EventRecurrenceInfoWeekly extends React.Component<IEventRecurrenceI
|
||||||
this.applyRecurrence();
|
this.applyRecurrence();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param date
|
|
||||||
* @memberof EventRecurrenceInfoDaily
|
|
||||||
*/
|
|
||||||
private formatDate(date: Date): string {
|
|
||||||
return toLocaleShortDateString(date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
@ -419,7 +408,7 @@ export class EventRecurrenceInfoWeekly extends React.Component<IEventRecurrenceI
|
||||||
label={strings.StartDateLabel}
|
label={strings.StartDateLabel}
|
||||||
value={this.state.startDate}
|
value={this.state.startDate}
|
||||||
onSelectDate={this.onStartDateChange}
|
onSelectDate={this.onStartDateChange}
|
||||||
formatDate={this.formatDate}
|
formatDate={toLocaleShortDateString}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -446,7 +435,7 @@ export class EventRecurrenceInfoWeekly extends React.Component<IEventRecurrenceI
|
||||||
ariaLabel={strings.StartDatePlaceHolder}
|
ariaLabel={strings.StartDatePlaceHolder}
|
||||||
style={{ display: 'inline-block', verticalAlign: 'top', paddingLeft: '22px', }}
|
style={{ display: 'inline-block', verticalAlign: 'top', paddingLeft: '22px', }}
|
||||||
onSelectDate={this.onEndDateChange}
|
onSelectDate={this.onEndDateChange}
|
||||||
formatDate={this.formatDate}
|
formatDate={toLocaleShortDateString}
|
||||||
value={this.state.endDate}
|
value={this.state.endDate}
|
||||||
disabled={this.state.disableEndDate}
|
disabled={this.state.disableEndDate}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -109,16 +109,6 @@ export class EventRecurrenceInfoYearly extends React.Component<IEventRecurrenceI
|
||||||
this.applyRecurrence();
|
this.applyRecurrence();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param date
|
|
||||||
* @memberof EventRecurrenceInfoDaily
|
|
||||||
*/
|
|
||||||
private formatDate(date: Date): string {
|
|
||||||
return toLocaleShortDateString(date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
@ -582,7 +572,7 @@ export class EventRecurrenceInfoYearly extends React.Component<IEventRecurrenceI
|
||||||
label={strings.StartDateLabel}
|
label={strings.StartDateLabel}
|
||||||
value={this.state.startDate}
|
value={this.state.startDate}
|
||||||
onSelectDate={this.onStartDateChange}
|
onSelectDate={this.onStartDateChange}
|
||||||
formatDate={this.formatDate}
|
formatDate={toLocaleShortDateString}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -609,7 +599,7 @@ export class EventRecurrenceInfoYearly extends React.Component<IEventRecurrenceI
|
||||||
ariaLabel={strings.StartDatePlaceHolder}
|
ariaLabel={strings.StartDatePlaceHolder}
|
||||||
style={{ display: 'inline-block', verticalAlign: 'top', paddingLeft: '22px', }}
|
style={{ display: 'inline-block', verticalAlign: 'top', paddingLeft: '22px', }}
|
||||||
onSelectDate={this.onEndDateChange}
|
onSelectDate={this.onEndDateChange}
|
||||||
formatDate={this.formatDate}
|
formatDate={toLocaleShortDateString}
|
||||||
value={this.state.endDate}
|
value={this.state.endDate}
|
||||||
disabled={this.state.disableEndDate}
|
disabled={this.state.disableEndDate}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue