Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Sort by Modified not working #65

Open
watanabethais opened this issue Jul 30, 2019 · 1 comment
Open

Sort by Modified not working #65

watanabethais opened this issue Jul 30, 2019 · 1 comment

Comments

@watanabethais
Copy link

I've tried to use the following code, but it continues sorting by name:

import FileBrowser, { FileRenderers, Sorters }  from 'react-keyed-file-browser';

<FileBrowser
       files={this.state.files}
       sort={Sorters.SortByModified}
       fileRenderer={CustomFileRenderer}  />

Am I missing something in here?

@scaredcat
Copy link
Contributor

Hi @watanabethais

Are you able to check whether your this.state.files have a modified date on the individual files?
Similar to the example below

      {
        key: 'elephant.png',
        modified: +Moment().subtract(3, 'days'),
        size: 52 * 1024,
      },

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants