As mentioned a keyword for milliseconds is missing.
I built a javascript clock for practise and run into the same problem but I already built an interface for toLocaleString so I decide to add my own feature that probably won't work with all languages but it's good enough.
I choose millisecond as keyword. I think as format information a combination of using n-digit like 2-digit and anything for no specific millisecond format (cause also include numeric) would be enough.
As connection I use colon when the format of hourCycle is defined as h23 or h24 and space else.
(Code in snippet without error handling, trigger is onchange so fill in en and than change hourCycle to h11)
function toLocalStringFromDate(nDate, nLanguage, nOptions){
if("millisecond" in nOptions){ // own keyword option
if(nOptions.millisecond.endsWith("-digit")){
let tDigits = parseInt(nOptions.millisecond.substring(0, nOptions.millisecond.length-6));
// extract amount of digits from format
let tLength = (""+nDate.getMilliseconds()).length;
// length of current milliseconds
return nDate.toLocaleString(nLanguage, nOptions)
// basic formatting
+("hourCycle" in nOptions && (nOptions.hourCycle == "h23" || nOptions.hourCycle == "h24") ? ':' : ' ')
// separator
+("0".repeat(tDigits)+nDate.getMilliseconds()).substring(tLength, tDigits+tLength);
// n-digit of zeros followed by milliseconds shifted by n digit is substring(tDigits+tLength-tDigits, tDigits+tLength);
}
else{
return nDate.toLocaleString(nLanguage, nOptions)+("hourCycle" in nOptions && (nOptions.hourCycle == "h23" || nOptions.hourCycle == "h24") ? ':' : ' ')+nDate.getMilliseconds();
}
}
else{
return nDate.toLocaleString(nLanguage, nOptions);
}
}
window.document.body.children[1].lastElementChild.value = "{\"hourCycle\": \"h23\", \"millisecond\": \"3-digit\"}";
input{width: 60%;}
<p><b>Language: </b><input onchange="console.log(toLocalStringFromDate(new Date(), this.value, JSON.parse(this.parentElement.nextElementSibling.lastElementChild.value)));"></p>
<p><b>Options: </b><input onchange="console.log(toLocalStringFromDate(new Date(), this.parentElement.previousElementSibling.lastElementChild.value, JSON.parse(this.value)));"></p>