Skip to content

Commit

Permalink
change: /_includes/pro/resume/work.html calculation iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobgabriel committed Dec 26, 2023
1 parent 179e405 commit 3c887ad
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions _includes/pro/resume/work.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,24 @@ <h2 id="work" class="h3 hr-bottom">
{% assign todayDate = todayYear | append: '-' | append: todayMonth %}

{% if startDate > todayDate %}
<i class="faded">not started</i>
<i class="faded">Not started</i>
{% else %}
{% assign yearDiff = endYear | minus: startYear %}
{% assign monthDiff = endMonth | minus: startMonth %}
{% assign totalMonths = yearDiff | times: 12 | plus: monthDiff %}

{% if monthDiff < 0 %}
{% assign monthDiff = monthDiff | plus: 12 %}
{% assign yearDiff = yearDiff | minus: 1 %}
{% if totalMonths < 0 %}
{% assign totalMonths = 0 %}
{% endif %}

{% assign totalMonths = yearDiff | times: 12 | plus: monthDiff %}

{% assign finalYears = totalMonths | divided_by: 12 %}
{% assign finalMonths = totalMonths | modulo: 12 %}

{% if finalMonths == 0 and totalMonths > 0 %}
{% assign finalMonths = 12 %}
{% assign finalYears = finalYears | minus: 1 %}
{% endif %}

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




<!-- {% if work.startDate.size > 0 %}
<p class="faded">
{% assign todayYear = 'now' | date: "%Y" %} {% assign startYear =
Expand Down

0 comments on commit 3c887ad

Please sign in to comment.