Sort Active Appointments by Date

Howdy,

Is it possible to have active appointments sorted by 'Appointment Date - Closest First' by default when viewing active appointments? Currently it has to be sorted to that view every time which seems counter intuitive.

Cheers,
Casper

  • Vinod Dalvi

    Hi Casper,

    I hope you are well today and thank you for your question.

    If i am correct then I think you are talking about the appointments displayed in the admin area.

    Currently there isn't any option to sort by default active appointments by 'Appointment Date - Closest First' when viewing active appointments.

    I will move this over to the features & feedback section. This way it can be considered for future development, and we can also see what other community members think about the feature request.

    Currently we can achieve this developing a bit of custom coding, if you are comfortable with custom coding?

    Kind Regards,
    Vinod Dalvi

  • Vinod Dalvi

    Hi Casper,

    Thank you for your reply.

    To achieve it try changing the code in the following Appointments + plugin files as below.

    Appointments + plugin file:
    appointments/appointments.php

    Before Editing Code on Line Number 6413 :

    if(isset($_GET['app_order_by']))
    	$order_by = $_GET['app_order_by'];
    else
    	$order_by = '';

    After Editing Code on Line Number 6413 :

    if(isset($_GET['app_order_by']))
    	$order_by = $_GET['app_order_by'];
    else
    	$order_by = 'start';

    Before Editing Code on Line Number 6347 :

    if ( isset( $_GET['app_order_by']) && $_GET['app_order_by'] )
    	$order_by = esc_sql(str_replace( '_', ' ', $_GET['app_order_by'] ));
    else
    	$order_by = "ID DESC";

    After Editing Code on Line Number 6347 :

    if ( isset( $_GET['app_order_by']) && $_GET['app_order_by'] )
    	$order_by = esc_sql(str_replace( '_', ' ', $_GET['app_order_by'] ));
    else
    	$order_by = "start";

    Note: You are making changes in the plugin file and these changes will be overwritten and lost when you update the plugin and you will have to make these again after plugin updation.

    Best Regards,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.