Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Valid question; it is always better not to use arbitrary codes for such things. </p> <p>You can simply use the <a href="http://unicode.org/repos/cldr/trunk/common/bcp47/calendar.xml" rel="nofollow">values of <code>name</code> attribute</a> which CLDR uses:</p> <pre><code>&lt;key name="ca" description="Calendar algorithm key" alias="calendar"&gt; &lt;type name="buddhist" description="Thai Buddhist calendar"/&gt; &lt;type name="chinese" description="Traditional Chinese calendar"/&gt; &lt;type name="coptic" description="Coptic calendar"/&gt; ... &lt;type name="islamicc" description="Civil (algorithmic) Arabic calendar" deprecated="true" preferred="islamic-civil" alias="islamic-civil"/&gt; &lt;/key&gt; </code></pre> <p>But you can also, adapt the method that was used in CLDR data definition which consisted of using an extension to <a href="http://tools.ietf.org/html/bcp47" rel="nofollow">BCP47</a> ("<em>Tags for Identifying Languages</em>") called <a href="http://tools.ietf.org/html/rfc6067" rel="nofollow">RFC6067</a> for "identifying Unicode locale-based variations using language tags. The 'singleton' identifier for this extension is 'u'". For example, the language Thai is identified by <code>th</code>. Therefore, <code>th-u-ca-buddhist</code> identifies the locale as Thai with support for Buddhist calendar:</p> <pre><code> th-u-ca-buddhist | | | | | +--&gt; Calendar name (values in CLDR bcp47/calendar.xml). | +-----&gt; 2 char key defining extension to follow (here "ca" for calendar). +--------&gt; Identifies that extension U values are to follow. </code></pre> <p>Few more extended usage examples:</p> <ul> <li><code>fa-u-ca-islamic-rgsa</code>: Farsi with Islamic calendar, Saudi Arabia sighting.</li> <li><code>fa-u-ca-persian</code>: Farsi with Persian calendar.</li> <li><code>fa_AF-u-ca-persian</code>: Farsi (Afghanistan) with Persian calendar.</li> </ul> <p>Obviously, if your intention is just to store the date and identifier for the calendar it is in, you can use <code>en</code>; i.e.</p> <pre><code> { 'year': 1392, 'month': 6 , 'day': 31 , 'calendar': 'en-u-ca-persian' } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload