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

Some sorting fixes. #1526

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/html/assets/themes/fabrizio1.0/javascripts/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ var Gallery = (function($) {
var pinnedClass = !batchEmpty && OP.Batch.exists(item.id) ? 'pinned' : '';
var imageContainer = $('<div class="imageContainer photo-id-'+item.id+' '+pinnedClass+'"/>');

var d = new Date(item.dateTaken*1000);

var pathKey = 'path' + configuration['thumbnailSize'];
var defaultWidthValue = configuration['defaultWidthValue'];
Expand Down Expand Up @@ -255,12 +254,13 @@ var Gallery = (function($) {
});

// insert calendar icon
var d = new Date(item.dateTakenYear, item.dateTakenMonth - 1, item.dateTakenDay);
currentDate = d.getYear()+'-'+d.getMonth()+'-'+d.getDay();
if(currentDate !== lastDate) {
if(breakOnDate)
parent.append(dateSeparator(item.dateTaken));
parent.append(dateSeparator(d));
else
imageContainer.append(dateSeparator(item.dateTaken));
imageContainer.append(dateSeparator(d));
}
lastDate = currentDate;

Expand Down
4 changes: 2 additions & 2 deletions src/libraries/adapters/DatabaseMySql.php
Original file line number Diff line number Diff line change
Expand Up @@ -1753,9 +1753,9 @@ private function buildQuery($filters, $limit, $offset, $table)
break;
case 'sortBy':
if($value === 'dateTaken,desc')
$sortBy = 'ORDER BY dateSortByDay DESC';
$sortBy = 'ORDER BY dateTaken DESC';
elseif($value === 'dateTaken,asc')
$sortBy = 'ORDER BY dateSortByDay ASC';
$sortBy = 'ORDER BY dateTaken ASC';
elseif($value === 'dateUploaded,desc')
$sortBy = 'ORDER BY dateSortByDay DESC, dateUploaded ASC';
elseif($value === 'dateUploaded,asc')
Expand Down