sort files by date and cludge (hard-coded mess) to make TZ +1
[BackupPC.git] / lib / BackupPC / SearchLib.pm
index 14f02ee..b9481f9 100644 (file)
@@ -32,6 +32,7 @@ sub getUnits() {
 
 sub epoch_to_iso {
        my $t = shift || return;
+       $t += 60 * 60 * +2;     # FIXME add TZ
        my $dt = DateTime->from_epoch( epoch => $t ) || return;
        print STDERR "BUG: $t != " . $dt->epoch . "\n" unless ($t == $dt->epoch);
        return $dt->ymd . ' ' . $dt->hms;
@@ -115,7 +116,7 @@ sub getFiles($$) {
        $sql_where = " WHERE ". $where if ($where);
 
        my $sql_order = qq{
-               ORDER BY files.id
+               ORDER BY files.date
                LIMIT $on_page
                OFFSET ?
        };