edtf.js
                                
                                
                                
                                    edtf.js copied to clipboard
                            
                            
                            
                        Unspecified digits incorrectly formatted
When a date contains unspecified digits, the format() function produces all X’s. For example:
> edtf.format(edtf.default('XXXX-04-01'));
// Expected: 4/1/X
// Actual: 4/1/?
> edtf.format(edtf.default('201X'));
// Expected: 2010s
// Actual: XXXX
> edtf.format(edtf.default('20XX'));
// Expected: 21st century
// Actual: XXXX
> edtf.format(edtf.default('20XX'));
// Expected: 3rd millennium
// Actual: XXXX
> edtf.format(edtf.default('XX00'));
// Expected (stretch goal): turn of the century
// Actual: X