Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add upload date in List View #15

Merged
merged 2 commits into from
Jun 5, 2019
Merged

Conversation

JtheDroid
Copy link
Contributor

@JtheDroid JtheDroid commented Apr 17, 2019

Adds the upload date in the List View as requested in Issue #13
Not displayed in Compact or Grid Views

Before:
image
After:
image
Date is formatted using the computer's default locale
Example: German locale:
image

Feel free to change anything

src/css/SongListItem.scss Outdated Show resolved Hide resolved
src/css/SongListItem.scss Outdated Show resolved Hide resolved
src/components/SongListItem.js Outdated Show resolved Hide resolved
@@ -49,6 +49,11 @@
white-space: nowrap;
text-overflow: ellipsis;
}
.upload-date {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Selector should have depth of applicability no greater than 2, but was 3

@@ -90,7 +90,7 @@ class SongList extends Component {
]
return (
<ContextMenuTrigger id={ song.hash || song.hashMd5 }>
<SongListItem key={ makeRenderKey(songTags) } title={ song.songName } ratings={ song.ratings } artist={ song.authorName } uploader={ song.uploader } difficulties={ song.difficulties || song.difficultyLevels } imageSource={ song.coverUrl } songKey={ song.key } hash={ song.hash || song.hashMd5 } file={ song.file } downloads={ song.downloadCount } upvotes={ song.upVotes } downvotes={ song.downVotes } plays={ song.playedCount } />
<SongListItem key={ makeRenderKey(songTags) } title={ song.songName } ratings={ song.ratings } artist={ song.authorName } uploader={ song.uploader } difficulties={ song.difficulties || song.difficultyLevels } imageSource={ song.coverUrl } songKey={ song.key } hash={ song.hash || song.hashMd5 } file={ song.file } downloads={ song.downloadCount } upvotes={ song.upVotes } downvotes={ song.downVotes } plays={ song.playedCount } uploadDate={ !!song.createdAt && !!song.createdAt.date && !!song.createdAt.timezone ? new Date(Date.parse(song.createdAt.date + " " + song.createdAt.timezone)).toLocaleString() : '' } />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not the best place to parse the date, but I didn't really know where else to do it

@StarGazer1258
Copy link
Owner

@JtheDroid Do you think it would look better as:

Uploaded 6/1/2018, 9:01:45 PM by rustic

or

Uploaded by rustic 6/1/2018, 9:01:45 PM

@JtheDroid
Copy link
Contributor Author

@StarGazer1258 I personally think

Uploaded by rustic 6/1/2018, 9:01:45 PM

looks better/makes more sense
I think it's more important who the uploader is and only secondary, when it was uploaded

But maybe the date could go somewhere else, that position was just my first idea

@StarGazer1258 StarGazer1258 merged commit 50a2442 into StarGazer1258:master Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants