Appointments manager best approach

Hey there,
I’m studying the smart way to develop an appointments scheduler for a doctor that make about ten medical visits a day.

I discarded the solution to create a page for each appointment (too many folders generation).
My current solution is to create a subpages for each day and manage the daily appointments by a structure field.

And now…questions? :slight_smile:

  1. Following my analysis I use a date format (dd/mm/yyyy) for subpages title, but there aren’t really dates (just text), so in subpages detail I have to add a real date field to sort subpages.
    It works but it’s not very elegant because it looks like a repetition.
    Does someone has got a better idea for title valuing?

This methology has got another problem: when I create a new day subpage and title it for example with 01/01/2016, the folder generated loses the first “01” (I think for sort rules). So if you later create the 02/01/2016 day a UID problem appears.

2)Is there a way to visualize subpages date order in a dd/mm/yyyy format?

Thanks!

The problem is that you cannot have titles/UIDs that start with a number. That’s the way Kirby works. So you would have to give your days other titles like “December 19, 2015” or something like that.

As regards the way the date is shown in the sidebar, I don’t think that can be changed out of the box.

Concerning 2): You can use a custom format for your date fields, see this page in the docs.

Yes, I used it (see first image DD/MM/YYYY).

The format date question was for days page list in Calendar parent page.

If you need to change this absolutely, you could hack the source, i.e. in panel/app/src/panel/models/page.php, line 468 change

   return date('Y/m/d', strtotime($this->num()));

to

  return date('d/m/Y', strtotime($this->num()));

Not recommended though, because these changes will be overwritten when you update Kirby.

  return date('d/m/Y', strtotime($this->num()));

Yes, it’s dangerous, but…it works, Thanks!

For the first question, in the end, I used this hook:

kirby()->hook('panel.page.update', function($page) {
  if ($page->isChildOf(page('calendario'))){
    $page->update(array(
      'title' => 'Appuntamenti ' . $page->date('d/m/Y')
    ));
	$page->move('Appuntamenti ' . $page->date('d/m/Y') );
  }
});