I have created a view with date expose filter. Currently filter is working fine but i need to reorder the day and month.

From month/day/year

enter image description here

To day/month/year


Got the settings Home » Administration » Configuration » Regional and language

  • I think you should add some more details about the actual settings "there", and also explain how to adapt them ... Just a suggestion ... – Pierre.Vriens Aug 15 '16 at 10:23

You need to use form_alter to accomplish without any date format change from configuration. The example is below.

function mymodule_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'views_exposed_form') {
    $view = $form_state['view'];
    if ($view->name == 'my_view_machine_name' && $view->current_display == 'display_name') {
      // alter your exposed form here
      $form['date_filter']['value']['#date_format'] = 'd-M-Y';
  • Thanks @vgoradiya for your suggestion. Currently i am able to solve my issue from settings. But i will definitely check this answer and let you know. Thanks again. – DRUPWAY Apr 18 '16 at 7:24
  • No issues. Actually I already implement and suggest the same code. – vgoradiya Apr 18 '16 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.