mirror of
https://github.com/pnp/sp-dev-fx-webparts.git
synced 2025-02-09 06:25:01 +00:00
Client Sorting, not every Source support this
This commit is contained in:
parent
9cfbdaf142
commit
2ecc46ce3c
@ -109,7 +109,7 @@ export default class CalendarFeedSummary extends React.Component<ICalendarFeedSu
|
||||
|
||||
// put everything together in a nice little calendar view
|
||||
return (
|
||||
<div className={css(styles.calendarFeedSummary, styles.webPartChrome)} style={{backgroundColor: semanticColors.bodyBackground}}>
|
||||
<div className={css(styles.calendarFeedSummary, styles.webPartChrome)} style={{ backgroundColor: semanticColors.bodyBackground }}>
|
||||
<div className={css(styles.webPartHeader, styles.headerSmMargin)}>
|
||||
<WebPartTitle displayMode={this.props.displayMode}
|
||||
title={this.props.title}
|
||||
@ -265,7 +265,7 @@ export default class CalendarFeedSummary extends React.Component<ICalendarFeedSu
|
||||
event={item}
|
||||
isNarrow={true}
|
||||
themeVariant={this.props.themeVariant}
|
||||
/>
|
||||
/>
|
||||
)} />
|
||||
{usePaging &&
|
||||
<Pagination
|
||||
@ -307,7 +307,7 @@ export default class CalendarFeedSummary extends React.Component<ICalendarFeedSu
|
||||
event={event}
|
||||
isNarrow={false}
|
||||
themeVariant={this.props.themeVariant} />
|
||||
);
|
||||
);
|
||||
})}
|
||||
</FilmstripLayout>
|
||||
</div>
|
||||
@ -354,6 +354,10 @@ export default class CalendarFeedSummary extends React.Component<ICalendarFeedSu
|
||||
|
||||
try {
|
||||
let events = await dataProvider.getEvents();
|
||||
if (!!events && events.length > 0) {
|
||||
// order result bacause not every Dataprovider Support Order
|
||||
events = events.sort((a: ICalendarEvent, b: ICalendarEvent) => { return a.start > b.start ? 1 : - 1; });
|
||||
}
|
||||
if (dataProvider.MaxTotal > 0) {
|
||||
events = events.slice(0, dataProvider.MaxTotal);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user