1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-11-22 00:10:15 +00:00

Fix: Allow year-only dates ('YYYY').

This commit is contained in:
devlinjd 2015-10-27 21:07:45 -04:00
parent b0b2af8278
commit 9de5069c20

View File

@ -40,7 +40,7 @@ FluentDate/*.prototype*/.fmt = function( dt ) {
else if( /^\d{4}-\d{1,2}$/.test(dt) ) { // "2015-03", "1998-4"
return moment( dt, 'YYYY-MM' );
}
else if( /^\s\d{4}$/.test(dt) ) { // "2015"
else if( /^\s*\d{4}\s*$/.test(dt) ) { // "2015"
return moment( dt, 'YYYY' );
}
else if( /^\s*$/.test(dt) ) { // "", " "