According to the spec, the toISOString is currently defined to return a string 
in the format YYYY-MM-DDTHH:mm:ss.sssZ.
Specifically, there's a 3-digit fractional part introduced by a . (that's the 
".sss" above) appended to the seconds.

It is my understanding of the ISO8601 spec that fractional parts can start with 
either a dot or a comma, and that the number of digits in the fractional part 
needs to be agreed upon by both parties using that format. If my interpretation 
is correct, the current behavior seems to be problematic, in that if an API 
accepts more (or fewer) than 3 fractional digits, the result of this function 
needs to be further modified before they can be used against said API. Same 
goes for dot vs. comma.

Would it make sense then to augment the spec to have toISOString take optional 
parameters Date.prototype.toISOString([precision[, separator]])?

Thanks


---------------------------------------------------------------------
This e-mail is intended only for the use of the addressees.  Any copying, 
forwarding, printing or other use of this e-mail by persons other than the 
addressees is not authorized.  This e-mail may contain information that is 
privileged, confidential and exempt from disclosure. If you are not the 
intended recipient, please notify us immediately by return e-mail (including 
the original message in your reply) and then delete and discard all copies of 
the e-mail. 

Thank you.

---------------------------------------------------------------------

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to