Recenti messi in ordine di data (funzione su videoplayer)

This commit is contained in:
Gregorio
2019-02-25 18:45:48 +01:00
parent 2466c9798d
commit 340bb46c46
3 changed files with 14 additions and 2 deletions
+3
View File
@@ -107,6 +107,9 @@ class VideoPlayer extends React.Component {
tmp[j].timesWatched++;
tmp[j].lastWatched= new Date();
}
tmp.sort((a, b) => new Date(b.lastWatched).getTime() - new Date(a.lastWatched).getTime());
localStorage.setItem('lastWatched', JSON.stringify(tmp));