DEV Community

Bertold Kolics
Bertold Kolics

Posted on

A great resource for browser compatibility

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'});
Enter fullscreen mode Exit fullscreen mode

produces different results in Firefox 78 and in Firefox 83.

Firefox 78 result:

Firefox 83 result:

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)