1

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

2 Answers 2

0

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

1
  • I think you should add some more details about the actual settings "there", and also explain how to adapt them ... Just a suggestion ... Commented Aug 15, 2016 at 10:23
0

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';
    }
  }
}
2
  • 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
    Commented Apr 18, 2016 at 7:24
  • No issues. Actually I already implement and suggest the same code.
    – vgoradiya
    Commented Apr 18, 2016 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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