notifications : fix sorting
This commit is contained in:
parent
bb44f7727e
commit
62b2b8c617
2 changed files with 6 additions and 5 deletions
|
|
@ -16,6 +16,9 @@ return [
|
|||
'isValidated' => 'true'
|
||||
]);
|
||||
|
||||
$timezone = new DateTimeZone('Europe/Paris');
|
||||
$dateTime = new DateTime('now', $timezone);
|
||||
|
||||
$notification = [
|
||||
'location' => [
|
||||
'href' => (string) $href,
|
||||
|
|
@ -24,7 +27,7 @@ return [
|
|||
'uri' => (string) $project->url()
|
||||
]
|
||||
],
|
||||
'date' => $newPage->modified('YYYY-MM-DD'),
|
||||
'date' => $dateTime->format('Y-m-d\TH:i:sP'),
|
||||
'author' => [
|
||||
'name' => (string) kirby()->user()->name(),
|
||||
'email' => (string) kirby()->user()->email(),
|
||||
|
|
|
|||
|
|
@ -137,11 +137,9 @@ const tabs = computed(() => {
|
|||
});
|
||||
|
||||
const sortedNotifications = computed(() => {
|
||||
const sortedNotifications = notifications.value.sort((a, b) => {
|
||||
dayjs(b.date).diff(dayjs(a.date));
|
||||
return [...notifications.value].sort((a, b) => {
|
||||
return dayjs(b.date).diff(dayjs(a.date));
|
||||
});
|
||||
|
||||
return sortedNotifications;
|
||||
});
|
||||
|
||||
function changeTab(newValue) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue