Skip to content

Commit

Permalink
Dates should always be sorted numerically
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Jan 4, 2018
1 parent 0feeb74 commit 72abab6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v1.4.0-rc.1
## mm/dd/2017

1. [](#bugfix)
* Date ordering should always be numeric [#1810](https://github.com/getgrav/grav/issues/1810)

# v1.4.0-beta.3
## 12/29/2017

Expand Down
8 changes: 4 additions & 4 deletions system/src/Grav/Common/Page/Pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -1203,19 +1203,19 @@ protected function buildSort($path, array $pages, $order_by = 'default', $manual
break;
case 'date':
$list[$key] = $child->date();
$sort_flags = SORT_REGULAR;
$sort_flags = SORT_NUMERIC;
break;
case 'modified':
$list[$key] = $child->modified();
$sort_flags = SORT_REGULAR;
$sort_flags = SORT_NUMERIC;
break;
case 'publish_date':
$list[$key] = $child->publishDate();
$sort_flags = SORT_REGULAR;
$sort_flags = SORT_NUMERIC;
break;
case 'unpublish_date':
$list[$key] = $child->unpublishDate();
$sort_flags = SORT_REGULAR;
$sort_flags = SORT_NUMERIC;
break;
case 'slug':
$list[$key] = $child->slug();
Expand Down

0 comments on commit 72abab6

Please sign in to comment.