1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-12-22 13:37:21 +00:00

Merge pull request #186 from ryneeverett/same-value-dateRange

When date ranges are identical, only show one.
This commit is contained in:
hacksalot 2018-01-25 12:43:48 -05:00 committed by GitHub
commit d25f8d0f97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -589,7 +589,9 @@ Generic template helper definitions for HackMyResume / FluentCV.
dateTemp = FluentDate.fmt(dateB);
dateTo = dateTemp.format(fmt);
}
if (dateFrom && dateTo) {
if (dateFrom === dateTo) {
return dateFrom;
} else if (dateFrom && dateTo) {
return dateFrom + sep + dateTo;
} else if (dateFrom || dateTo) {
return dateFrom || dateTo;

View File

@ -551,7 +551,10 @@ _fromTo = ( dateA, dateB, fmt, sep, fallback ) ->
dateTemp = FluentDate.fmt( dateB )
dateTo = dateTemp.format( fmt )
if dateFrom && dateTo
if dateFrom == dateTo
return dateFrom
else if dateFrom && dateTo
return dateFrom + sep + dateTo
else if dateFrom || dateTo
return dateFrom || dateTo