Browse Source

Adding correct regional for the jquery-ui datepicker lib

Julio Montoya 13 years ago
parent
commit
4606192798
2 changed files with 9 additions and 2 deletions
  1. 7 0
      main/calendar/agenda_js.php
  2. 2 2
      main/template/default/agenda/month.tpl

+ 7 - 0
main/calendar/agenda_js.php

@@ -74,6 +74,13 @@ $tpl->assign('button_text', 		json_encode(array(	'today'	=> get_lang('Today'),
 //see http://docs.jquery.com/UI/Datepicker/$.datepicker.formatDate
 
 $tpl->assign('js_format_date', 	'D d M yy');
+$region_value = api_get_language_isocode();
+
+if ($region_value == 'en') {
+    $region_value = 'en-GB';
+}
+$tpl->assign('region_value', 	$region_value);
+
 
 if (api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous()) && api_is_allowed_to_session_edit(false,true)) {
     if ($type == 'course') {

+ 2 - 2
main/template/default/agenda/month.tpl

@@ -18,7 +18,7 @@ function clean_user_select() {
         .end();
 }
 
-var reg = 'fr';
+var region_value = '{$region_value}';
 $(document).ready(function() {
 
     /*$("body").delegate(".datetime", "focusin", function(){
@@ -81,7 +81,7 @@ $(document).ready(function() {
         }
     });
     
-    $.datepicker.setDefaults( $.datepicker.regional["fr"] );
+    $.datepicker.setDefaults( $.datepicker.regional[region_value] );
 	
 	var calendar = $('#calendar').fullCalendar({
 		header: {