@@ -539,7 +539,7 @@ function add_multiple_required_rule($elements, $message)
539539 * If an element in the form didn't validate, an error message is showed
540540 * asking the user to complete the form.
541541 */
542- function display ()
542+ public function display ()
543543 {
544544 echo $ this ->return_form ();
545545 }
@@ -571,20 +571,22 @@ public function return_form()
571571 $ return_value = '' ;
572572 $ js = null ;
573573 if ($ addDateLibraries ) {
574- $ js = api_get_js ('jquery-ui/jquery-ui-i18n.min.js ' );
574+
575+ $ js .= '<script src=" ' .api_get_path (WEB_LIBRARY_PATH ).'javascript/daterange/moment.min.js" type="text/javascript"></script> ' ;
575576 $ js .= '<script src=" ' .api_get_path (WEB_LIBRARY_PATH ).'javascript/datetimepicker/jquery-ui-timepicker-addon.js" type="text/javascript"></script> ' ;
576577 $ js .= '<link href=" ' .api_get_path (WEB_LIBRARY_PATH ).'javascript/datetimepicker/jquery-ui-timepicker-addon.css" rel="stylesheet" type="text/css" /> ' ;
577- $ js .= '<script src=" ' .api_get_path (WEB_LIBRARY_PATH ).'javascript/daterange/moment.min.js" type="text/javascript"></script> ' ;
578578 $ js .= '<script src=" ' .api_get_path (WEB_LIBRARY_PATH ).'javascript/daterange/daterangepicker.js" type="text/javascript"></script> ' ;
579579 $ js .= '<link href=" ' .api_get_path (WEB_LIBRARY_PATH ).'javascript/daterange/daterangepicker-bs2.css" rel="stylesheet" type="text/css" /> ' ;
580580
581- $ isocode = api_get_language_isocode ();
582- if ($ isocode != 'en ' ) {
583- $ js .= '<script src=" ' .api_get_path (WEB_LIBRARY_PATH ).'javascript/datetimepicker/i18n/jquery-ui-timepicker- ' .$ isocode .'.js" type="text/javascript"></script> ' ;
581+ $ isoCode = api_get_language_isocode ();
582+
583+ if ($ isoCode != 'en ' ) {
584+ $ js .= api_get_js ('jquery-ui/jquery-ui-i18n.min.js ' );
585+ $ js .= '<script src=" ' .api_get_path (WEB_LIBRARY_PATH ).'javascript/datetimepicker/i18n/jquery-ui-timepicker- ' .$ isoCode .'.js" type="text/javascript"></script> ' ;
584586 $ js .= '<script>
585587 $(function(){
586- $.datepicker.setDefaults($.datepicker.regional[ " ' .$ isocode .'"] );
587- moment.lang( " ' .$ isocode .'");
588+ moment.lang( " ' .$ isoCode .'");
589+ $.datepicker.setDefaults($.datepicker.regional[ " ' .$ isoCode .'"] );
588590 });
589591 </script> ' ;
590592 }
0 commit comments