Fix timeline order with sqlite3. It should be ordered as MySQL and PGSQL like (year, month, day). (#954)
This commit is contained in:
parent
6693920b61
commit
ddacba85db
|
@ -24,7 +24,7 @@ func MyTimeline(db *gorm.DB, user *models.User, paginate *models.Pagination, onl
|
||||||
Order("media.date_shot DESC")
|
Order("media.date_shot DESC")
|
||||||
case drivers.SQLITE:
|
case drivers.SQLITE:
|
||||||
query = query.
|
query = query.
|
||||||
Order("strftime('%j', media.date_shot) DESC"). // convert to day of year 001-366
|
Order("strftime('%Y-%m-%d', media.date_shot) DESC"). // convert to YYYY-MM-DD
|
||||||
Order("albums.title ASC").
|
Order("albums.title ASC").
|
||||||
Order("TIME(media.date_shot) DESC")
|
Order("TIME(media.date_shot) DESC")
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue