CRM-16019 - Expose date/time format preferences to clientside
authorColeman Watts <coleman@civicrm.org>
Thu, 26 Feb 2015 21:55:02 +0000 (16:55 -0500)
committerColeman Watts <coleman@civicrm.org>
Mon, 2 Mar 2015 15:29:47 +0000 (10:29 -0500)
templates/CRM/common/l10n.js.tpl

index 44f5498a55963a841eee0351c163368b681a1e05..5984e543f6f45e7a6e646ab49dc5374d094a9b11 100644 (file)
@@ -30,6 +30,8 @@
   CRM.config.userFramework = {$config->userFramework|@json_encode};
   CRM.config.resourceBase = {$config->resourceBase|@json_encode};
   CRM.config.lcMessages = {$config->lcMessages|@json_encode};
+  $.datepicker._defaults.dateFormat = CRM.config.dateInputFormat = {$config->dateInputFormat|@json_encode};
+  CRM.config.timeIs24Hr = {if $config->timeInputFormat eq 2}true{else}false{/if};
 
   // Merge entityRef settings
   CRM.config.entityRef = $.extend({ldelim}{rdelim}, {$entityRef|@json_encode}, CRM.config.entityRef || {ldelim}{rdelim});