mirror of
				https://github.com/JuanCanham/HackMyResume.git
				synced 2025-10-31 21:27:26 +00:00 
			
		
		
		
	Support additional date formats.
Support "Now" in addition to "Present" along with year-only dates of the form "YYYY".
This commit is contained in:
		| @@ -103,13 +103,16 @@ Abstract character/resume sheet representation. | ||||
|   */ | ||||
|   function _fmt( dt ) { | ||||
|     dt = dt.toLowerCase().trim(); | ||||
|     if( dt === 'present' ) { | ||||
|     if( /\s*(present|now)\s*/i.test(dt) ) { // "Present", "Now" | ||||
|       return moment(); | ||||
|     } | ||||
|     else if( /^\D+/.test(dt) ) { | ||||
|     else if( /^\D+/.test(dt) ) { // "Mar 2015" | ||||
|       var parts = dt.split(' '); | ||||
|       return moment( parts[1] + '-' + (months[ parts[0] ] || abbr[ parts[0] ] || ( parts[0] === 'sept' && '09' )) + '-' + '01', 'YYYY-MM-DD' ); | ||||
|     } | ||||
|     else if( /^\d+$/.test(dt) ) { // "2015" | ||||
|       return moment( dt, 'YYYY' ); | ||||
|     } | ||||
|     else { | ||||
|       var mt = moment( dt ); | ||||
|       if(mt.isValid()) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user