Topic: date_picker is not defined in version 2. 4RC.

I am working with a custom module. When i have used the code

 if (user_use_date_picker ()){
 $js .= get_js_date_picker (); 
} 

And i used date_row () function for the date picker.

But it's not working.  I have seen this error on the console.

`date_picker is not defined`

Subscription service based on FA
HRM CRM POS batch Themes

Re: date_picker is not defined in version 2. 4RC.

It looks like a missing include file.

Joe

3 (edited by apmuthu 09/23/2016 04:27:59 pm)

Re: date_picker is not defined in version 2. 4RC.

The function user_use_date_picker () is not part of core FA 2.3 but in includes/current_user.inc in FA 2.4. Assume it is part of your module.

function user_use_date_picker()
{
    return $_SESSION["wa_current_user"]->prefs->use_date_picker();
}

The function get_js_date_picker is in FA 2.3 and FA 2.4 in includes/ui/ui_view.inc.

The version of the above function in FA 2.3 uses:

$fpath = company_path().'/js_cache/'.'date_picker.js';

whilst that in FA 2.4 uses:

$fpath = user_js_cache().'/'.'date_picker.js';

Re: date_picker is not defined in version 2. 4RC.

The function user_use_date_picker() is defined in release 2.4 in file /includes/current_user.inc on line 582.

Check that you have this file included, otherwise the function is undefined.

/Joe

Re: date_picker is not defined in version 2. 4RC.

Thanks @Joe  And @Apmuthu,  I have solved the problem by referring the js file.  It's solved now.

Subscription service based on FA
HRM CRM POS batch Themes