mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Add modified_value and modified_display so we can use the formatted date but still sort correctly
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
542ab75d89
commit
1b1b54fbf4
|
@ -1018,17 +1018,25 @@ class SettingsController extends Controller
|
|||
$backup_files = Storage::files($path);
|
||||
$files_raw = [];
|
||||
|
||||
|
||||
if (count($backup_files) > 0) {
|
||||
for ($f = 0; $f < count($backup_files); $f++) {
|
||||
|
||||
// Skip dotfiles like .gitignore and .DS_STORE
|
||||
if ((substr(basename($backup_files[$f]), 0, 1) != '.')) {
|
||||
//$lastmodified = Carbon::parse(Storage::lastModified($backup_files[$f]))->toDatetimeString();
|
||||
$file_timestamp = Storage::lastModified($backup_files[$f]);
|
||||
|
||||
|
||||
$files_raw[] = [
|
||||
'filename' => basename($backup_files[$f]),
|
||||
'filesize' => Setting::fileSizeConvert(Storage::size($backup_files[$f])),
|
||||
'modified' => Storage::lastModified($backup_files[$f]),
|
||||
'modified_value' => $file_timestamp,
|
||||
'modified_display' => Helper::getFormattedDateObject($file_timestamp, $type = 'datetime', false),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue