mirror of
https://github.com/pnp/sp-dev-fx-webparts.git
synced 2025-02-09 22:44:59 +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
|
// put everything together in a nice little calendar view
|
||||||
return (
|
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)}>
|
<div className={css(styles.webPartHeader, styles.headerSmMargin)}>
|
||||||
<WebPartTitle displayMode={this.props.displayMode}
|
<WebPartTitle displayMode={this.props.displayMode}
|
||||||
title={this.props.title}
|
title={this.props.title}
|
||||||
@ -265,7 +265,7 @@ export default class CalendarFeedSummary extends React.Component<ICalendarFeedSu
|
|||||||
event={item}
|
event={item}
|
||||||
isNarrow={true}
|
isNarrow={true}
|
||||||
themeVariant={this.props.themeVariant}
|
themeVariant={this.props.themeVariant}
|
||||||
/>
|
/>
|
||||||
)} />
|
)} />
|
||||||
{usePaging &&
|
{usePaging &&
|
||||||
<Pagination
|
<Pagination
|
||||||
@ -307,7 +307,7 @@ export default class CalendarFeedSummary extends React.Component<ICalendarFeedSu
|
|||||||
event={event}
|
event={event}
|
||||||
isNarrow={false}
|
isNarrow={false}
|
||||||
themeVariant={this.props.themeVariant} />
|
themeVariant={this.props.themeVariant} />
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</FilmstripLayout>
|
</FilmstripLayout>
|
||||||
</div>
|
</div>
|
||||||
@ -354,6 +354,10 @@ export default class CalendarFeedSummary extends React.Component<ICalendarFeedSu
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
let events = await dataProvider.getEvents();
|
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) {
|
if (dataProvider.MaxTotal > 0) {
|
||||||
events = events.slice(0, dataProvider.MaxTotal);
|
events = events.slice(0, dataProvider.MaxTotal);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user