I found my way with this : Auto-sort and auto-filter an structured events list with a Kirby Hook and page model
Final hook with desc sort (‘date’ is my 2nd structure fields)
kirby()->hook('panel.page.update', function($page) {
if(isset($page->content()->data['my_dates'])) {
$dates = $page->my_dates()->yaml();
usort($dates, function($a, $b) {
if($a['date']==$b['date']) return 0;
return $a['date'] < $b['date']?1:-1;
});
try {
$page->update(array(
'my_dates' => yaml::encode($dates)
));
} catch(Exception $e) {
echo $e->getMessage();
}
}
});