The Mozilla Developer Network is a fantastic resource for finding out about browser compatibility issues especially when you are working with JavaScript.
I was reminded of this when I was trying to get Firefox 78 ESR (extended support release) to format time for me and I realized that it only supports the timeStyle option in version 79 or later.
So, for example, this snippet:
const date = new Date();
date.toLocaleTimeString('en', {timeStyle: 'short'});
produces different results in Firefox 78 and in Firefox 83.
As you can see, Firefox 78 will display seconds, but the newer version will adhere to the short time style and not display that field.
Top comments (0)