Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2515
How to change date patterns for different regions
posted

We are using igLoader to take advantage of the regional support provided by igniteUI. The following is how we instantiate the loader. This appears to work fine.

However, we want the dateTime pattern to be MM/dd/yyyy HH:mm, so we modified the Infragistics.ui.regional-en.js file in the js/modules/i18n/regional folder to indicate these patterns. However, we still get the pattrn M/d/yyyy hh:mm tt when running with the US region.

In this instance, the regional option is begin set to 'en'. Using 'en-US' fails.

How do we change the patterns used for US (or an other region)?

 <script type="text/javascript" src="../igniteui/2015.2/js/infragistics.loader.js"></script>

<script>
 function getLang()
 {
  var lang;
  if (navigator.browserLanguage != undefined)
   lang = navigator.browserLanguage;
  else if (navigator.languages != undefined)
   lang = navigator.languages[0];
  else
   lang = navigator.language;
  
  if (lang == "en-US") lang = "en";
  
  return lang;
 }

 $.ig.loader({
  scriptPath: "../igniteui/2015.2/js/",
  cssPath: "../igniteui/2015.2/css/",
  resources: "igGrid.*,igDialog,igCombo,igHierarchicalGrid.*",
  regional: getLang()
  });
</script>