diff --git a/_includes/table.html b/_includes/table.html index 2eb00b9e82dc..fbaece399e3f 100644 --- a/_includes/table.html +++ b/_includes/table.html @@ -23,6 +23,11 @@ see https://jekyllrb.com/docs/liquid/filters/#date-to-string. - timeago: display the value using the timeago filter, see https://github.com/markets/jekyll-timeago. + - end-date: display the value as an end of something date (such as support or EOL). + This is the "classic" way do display end of support or EOL date on endoflife.date, with: + - a background color as a visual indication, + - the value displayed using both the date_to_string and timeago filters, + - a support for both boolean and date values. {% endcomment %} {%- assign labels = include.labels | split:',' %} {%- assign fields = include.fields | split:',' %} @@ -38,10 +43,29 @@ {%- for row in rows %} {%- for field in fields %} - {%- if types[forloop.index0] == "date" %} - {{ row[field] | date_to_string }} - {%- elsif types[forloop.index0] == "timeago" %} - {{ row[field] | timeago }} + {%- assign type = types[forloop.index0] %} + {%- assign value = row[field] %} + {%- if type == "date" %} + {{ value | date_to_string }} + {%- elsif type == "timeago" %} + {{ value | timeago }} + {%- elsif type == "end-date" %} + {%- if value == true %} + Yes + {%- elsif value == false %} + No + {%- else %} + {%- assign row_date = row[field] | date: '%s' %} + {%- assign site_date = site.time | date: '%s' %} + {%- assign days_between = row_date | minus: site_date | divided_by: 86400 %} + {%- if days_between < 0 %} + Ended {{ row[field] | timeago }}
({{ row[field] | date_to_string }})
+ {%- elsif days_between < 120 %} + Ends {{ row[field] | timeago }}
({{ row[field] | date_to_string }})
+ {%- else %} + Ends {{ row[field] | timeago }}
({{ row[field] | date_to_string }})
+ {%- endif %} + {%- endif %} {%- else %} {{ row[field] }} {%- endif %} diff --git a/products/vmware-esxi.md b/products/vmware-esxi.md index d30f694a2bf2..0d4d0a98e1fb 100644 --- a/products/vmware-esxi.md +++ b/products/vmware-esxi.md @@ -87,5 +87,5 @@ support, server/client/guest OS updates, new security patches or bug fixes unles {% include table.html labels="Release,Technical Guidance Ends" fields="releaseCycle,technicalGuidance" -types="raw,timeago" +types="raw,end-date" rows=page.releases %} diff --git a/products/vmware-horizon.md b/products/vmware-horizon.md index c4781458f031..e722dd1fee12 100644 --- a/products/vmware-horizon.md +++ b/products/vmware-horizon.md @@ -125,5 +125,5 @@ support, server/client/guest OS updates, new security patches or bug fixes unles {% include table.html labels="Release,Technical Guidance Ends" fields="releaseCycle,technicalGuidance" - types="raw,timeago" + types="raw,end-date" rows=page.releases %} diff --git a/products/vmware-srm.md b/products/vmware-srm.md index 66a4b0a3bdcb..f271abd59dda 100644 --- a/products/vmware-srm.md +++ b/products/vmware-srm.md @@ -132,5 +132,5 @@ support, server/client/guest OS updates, new security patches or bug fixes unles {% include table.html labels="Release,Technical Guidance Ends" fields="releaseCycle,technicalGuidance" -types="raw,timeago" +types="raw,end-date" rows=page.releases %} diff --git a/products/vmware-vcenter.md b/products/vmware-vcenter.md index fca0d3c88faf..cdcf9834cb51 100644 --- a/products/vmware-vcenter.md +++ b/products/vmware-vcenter.md @@ -109,5 +109,5 @@ support, server/client/guest OS updates, new security patches or bug fixes unles {% include table.html labels="Release,Technical Guidance Ends" fields="releaseCycle,technicalGuidance" -types="raw,timeago" +types="raw,end-date" rows=page.releases %}