Skip to content

Commit

Permalink
fix: duration calculation - iteration 3
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobgabriel committed Dec 28, 2023
1 parent c82ce56 commit 4ca367d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions _includes/pro/resume/work.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ <h2 id="work" class="h3 hr-bottom">
<p class="faded">
{% assign startYear = work.startDate | date: "%Y" | plus: 0 %}
{% assign startMonth = work.startDate | date: "%m" | plus: 0 %}
{% assign todayYear = 'now' | date: "%Y" | plus: 0 %}
{% assign todayMonth = 'now' | date: "%m" | plus: 0 %}
{% assign endYear = work.endDate | date: "%Y" | plus: 0 %}
{% assign endMonth = work.endDate | date: "%m" | plus: 0 %}

{% if work.endDate.size == 0 %}
{% assign todayYear = 'now' | date: "%Y" | plus: 0 %}
{% assign todayMonth = 'now' | date: "%m" | plus: 0 %}
{% assign endYear = todayYear %}
{% assign endMonth = todayMonth %}
{% endif %}
Expand All @@ -35,6 +35,11 @@ <h2 id="work" class="h3 hr-bottom">
{% assign monthDiff = monthDiff | plus: 12 %}
{% endif %}

{% if monthDiff == 11 %}
{% assign yearDiff = yearDiff | plus: 1 %}
{% assign monthDiff = 0 %}
{% endif %}

{% assign unitYear = "year" %}
{% if yearDiff != 1 %} {% assign unitYear = "years" %} {% endif %}
{% assign unitMonth = "month" %}
Expand All @@ -45,6 +50,7 @@ <h2 id="work" class="h3 hr-bottom">
</p>
{% endif %}



<!-- {% if work.startDate.size > 0 %}
<p class="faded">
Expand Down

0 comments on commit 4ca367d

Please sign in to comment.