Time Optional using the date_popup type
I needed to allow users to give either a datetime or just a date, so I needed to override the default date_popup behaviour. NOTE: I am not using the date fields provided with the date uri, just the date_popup form element.

You can override the default date_popup validation. The data_popup module applies the validation function during the date_popup_element_process function. 

I used a hook_element_info_alter function to append a custom process function AFTER the date_popup_element_process and applied my own validation function. Like so:

function hook_element_info_alter(&amp;$type) {
    $type['date_popup']['#process'][] = 'my_popup_date_process';
}

function my_popup_date_process($element, &amp;$form_state, $form) {
    $element['#element_validate'] = array('my_popup_date_validate');
    return $element;
}

function my_popup_date_validate() {
    if (isset($form_state['values'][$element['#field_name']])) {
        if (trim($form_state['values'][$element['#field_name']][$element['#language']][0]['time']) == '') {
            list($date_format, $time_format) = explode(" ", $element['#date_format']);
            $element['#date_format'] = trim($date_format);
        }
    }
    date_popup_validate($element, $form_state);
}


Removed unneeded code for brevity. Updated validation funciton with an example showing how this could be achieved. This example assumes that there is a space between the data and time formats (ie "d/m/Y H:i:s") and that the date format is first.