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

Allow variable-unit resume duration.

This commit is contained in:
hacksalot 2016-01-03 09:48:22 -05:00
parent 75e2b1c131
commit f2bf09bf96

View File

@ -359,7 +359,8 @@ Definition of the FRESHResume class.
*latest end date of all jobs in the work history*. This last condition is for
sheets that have overlapping jobs.
*/
FreshResume.prototype.duration = function() {
FreshResume.prototype.duration = function(unit) {
unit = unit || 'years';
var empHist = __.get(this, 'employment.history');
if( empHist && empHist.length ) {
var firstJob = _.last( this.employment.history );
@ -370,7 +371,7 @@ Definition of the FRESHResume class.
var careerLast = _.max( this.employment.history, function( w ) {
return( w.safe && w.safe.end ) ? w.safe.end.unix() : moment().unix();
});
return careerLast.safe.end.diff( careerStart, 'years' );
return careerLast.safe.end.diff( careerStart, unit );
}
return 0;
};