From d31f6caf50a8361d494a9a7157f17316f4bd8b68 Mon Sep 17 00:00:00 2001 From: ryneeverett Date: Fri, 6 Jan 2017 22:37:08 -0500 Subject: [PATCH] When date ranges are identical, only show one. --- dist/helpers/generic-helpers.js | 4 +++- src/helpers/generic-helpers.coffee | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dist/helpers/generic-helpers.js b/dist/helpers/generic-helpers.js index 6d65c56..a9da25e 100644 --- a/dist/helpers/generic-helpers.js +++ b/dist/helpers/generic-helpers.js @@ -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; diff --git a/src/helpers/generic-helpers.coffee b/src/helpers/generic-helpers.coffee index 242c4fc..dddef4d 100644 --- a/src/helpers/generic-helpers.coffee +++ b/src/helpers/generic-helpers.coffee @@ -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