title: How to do date masking using javascript (without JQuery)?
body: <pre><code>&lt;![CDATA[
      var $ = jQuery;
      String locale = getUserLocale();
      $(document).ready(function() {
  
          if (!isEmptyNull(locale) &amp;&amp; locale.equals("zh_CN")) {
              $("input[id*='text12']").mask('9999年99月99日');
          }
          else {
              $("input[id*='text12']").mask('99/99/9999');
          }
      });
  ]]&gt;
  
  &lt;p:calendar id="text12" styleClass="calendar" maxlength="10" pattern="#
  {pc_Test.dateDisplayFormat}"&gt;&lt;/p:calendar&gt;
  </code></pre>
  
  <p>If the locale is equal to <code>'zh_CN',</code> the masking would be <code>'9999年99月99日'</code>. Otherwise, it would would be <code>'99/99/9999'</code>.<br>
  When I remove the if else command, it works. But if I put the if else command inside, it doesn't work.</p>
  
  <p>How do I solve it?</p>