edtf.js
                                
                                
                                
                                    edtf.js copied to clipboard
                            
                            
                            
                        TypeError when formatting interval
The format() function throws a TypeError when passing in an interval. For example:
edtf.format(edtf.default('2000/2001'))
throws:
Uncaught TypeError: Cannot read properties of undefined (reading 'value')
It might be possible to format some intervals natively using Intl.DateTimeFormat.prototype.formatRange(). However, this API doesn’t accept other kinds of intervals, such as /2001 and ../2001. Ultimately, I’d like to be able to rely on this library to output something like “before 2001”.