To get the human-readable version of their sample, I needed more code:

function myFunction() {
const dtf = new Intl.DateTimeFormat('en-GB-u-ca-islamic', { year: 'numeric', 
month: 'long', day: '2-digit' }) 

  var d = new Date("14 October, 2017");

const [{ value: mo },,{ value: da },,{ value: ye }] = dtf.formatToParts(d) 

  var n = dtf.formatToParts(d)
  document.getElementById("demo").innerHTML = da+" "+mo+" "+ye;
}

Which yielded

24 Muharram 1439

So, I guess it really is in there (assuming the output was right). The 
other article I read made it seem impossibly complex.

On Monday, April 13, 2020 at 9:53:10 AM UTC-7, PMario wrote:
>
> On Monday, April 13, 2020 at 4:50:44 PM UTC+2, Mark S. wrote:
>>
>> To me it looks like it does *format* conversion (how dates are 
>> presented), but maybe not actual data (date) conversion. 
>>
>
> Have a look at: 
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl
>  
> right *above *heading "Locale negotiation" there is a paragraph like: 
>
>
>>    - "en-GB-u-ca-islamic": use British English with the Islamic (Hijri) 
>>    calendar, where the Gregorian date 14 October, 2017 is the Hijri date 24 
>>    Muharram, 1439.
>>
>>
> Which looks promising. 
>
> -m
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/96b633ac-bace-4207-8419-e62ca592c7f6%40googlegroups.com.

Reply via email to