Skip to content

Commit a6738fd

Browse files
Update modules/ROOT/examples/live-demos/revisionhistory/index.js
Co-authored-by: Andrew Herron <[email protected]>
1 parent 6c1173d commit a6738fd

File tree

1 file changed

+3
-1
lines changed
  • modules/ROOT/examples/live-demos/revisionhistory

1 file changed

+3
-1
lines changed

modules/ROOT/examples/live-demos/revisionhistory/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ const revisions = [
139139

140140
const revisionhistory_fetch = () => new Promise((resolve) => {
141141
setTimeout(() => {
142-
resolve(revisions);
142+
const sortedRevisions = revisions
143+
.sort((a, b) => new Date(a.createdAt) < new Date(b.createdAt) ? -1 : 1);
144+
resolve(sortedRevisions);
143145
}, fakeDelay);
144146
});
145147

0 commit comments

Comments
 (0)