mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-05 09:56:22 +00:00
Fix glitch in converted CoffeeScript.
Replace naked ternary with if then else.
This commit is contained in:
parent
7c0a9bcc02
commit
e191af1fb0
8
dist/helpers/generic-helpers.js
vendored
8
dist/helpers/generic-helpers.js
vendored
@ -44,18 +44,14 @@ Generic template helper definitions for HackMyResume / FluentCV.
|
|||||||
@method formatDate
|
@method formatDate
|
||||||
*/
|
*/
|
||||||
formatDate: function(datetime, format, fallback) {
|
formatDate: function(datetime, format, fallback) {
|
||||||
var momentDate, ref, ref1;
|
var momentDate;
|
||||||
if (moment) {
|
if (moment) {
|
||||||
momentDate = moment(datetime);
|
momentDate = moment(datetime);
|
||||||
if (momentDate.isValid()) {
|
if (momentDate.isValid()) {
|
||||||
return momentDate.format(format);
|
return momentDate.format(format);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return datetime || ((ref = typeof fallback === 'string') != null ? ref : {
|
return datetime || (typeof fallback === 'string' ? fallback : (fallback === true ? 'Present' : null));
|
||||||
fallback: (ref1 = fallback === true) != null ? ref1 : {
|
|
||||||
'Present': null
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,7 +37,10 @@ GenericHelpers = module.exports =
|
|||||||
momentDate = moment datetime
|
momentDate = moment datetime
|
||||||
return momentDate.format(format) if momentDate.isValid()
|
return momentDate.format(format) if momentDate.isValid()
|
||||||
|
|
||||||
datetime || (typeof fallback == 'string' ? fallback : (fallback == true ? 'Present' : null));
|
datetime ||
|
||||||
|
if typeof fallback == 'string'
|
||||||
|
then fallback
|
||||||
|
else (if fallback == true then 'Present' else null)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user