Improved age display in service page.
This commit is contained in:
parent
a957413bc2
commit
85ea317bfe
4 changed files with 22 additions and 2 deletions
|
@ -21,6 +21,7 @@ package fr.devinsy.statoolinfos.core;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
@ -121,6 +122,24 @@ public class Service extends PathPropertyList
|
||||||
super(properties);
|
super(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the age.
|
||||||
|
*
|
||||||
|
* @return the age
|
||||||
|
*/
|
||||||
|
public String getAge()
|
||||||
|
{
|
||||||
|
String result;
|
||||||
|
|
||||||
|
LocalDate startDate = StatoolInfosUtils.parseDate(getStartDate());
|
||||||
|
LocalDate endDate = StatoolInfosUtils.parseDate(getEndDate());
|
||||||
|
|
||||||
|
result = StatoolInfosUtils.toHumanDuration(startDate, endDate);
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the contact email.
|
* Gets the contact email.
|
||||||
*
|
*
|
||||||
|
|
|
@ -123,6 +123,7 @@ public class ServicePage
|
||||||
|
|
||||||
data.setContent("serviceStartDate", StringUtils.defaultIfBlank(service.getStartDate(), "n/a"));
|
data.setContent("serviceStartDate", StringUtils.defaultIfBlank(service.getStartDate(), "n/a"));
|
||||||
data.setContent("serviceEndDate", StringUtils.defaultIfBlank(service.getEndDate(), "n/a"));
|
data.setContent("serviceEndDate", StringUtils.defaultIfBlank(service.getEndDate(), "n/a"));
|
||||||
|
data.setContent("serviceAge", StringUtils.defaultIfBlank(service.getAge(), "n/a"));
|
||||||
if (StringUtils.isBlank(service.getEndDate()))
|
if (StringUtils.isBlank(service.getEndDate()))
|
||||||
{
|
{
|
||||||
data.setAttribute("serviceEndDateData", "style", "display: none;");
|
data.setAttribute("serviceEndDateData", "style", "display: none;");
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
</div>
|
</div>
|
||||||
<p id="organizationDescription" class="center_table" style="width: 500px;">Description absente…</p>
|
<p id="organizationDescription" class="center_table" style="width: 500px;">Description absente…</p>
|
||||||
</div>
|
</div>
|
||||||
<div><span id="organizationStartDateWord">Depuis</span> <span id="organizationStartDate">n/a</span><span id="organizationEndDateData"> – Date d'arrêt : <span id="organizationEndDate">n/a</span></span> (<span id="organizationAge">n/a</span>)</div>
|
<div><span id="organizationStartDateWord">Depuis</span> <span id="organizationStartDate">n/a</span><span id="organizationEndDateData"> – <span id="organizationEndDate">n/a</span></span> (<span id="organizationAge">n/a</span>)</div>
|
||||||
<div>Membre <span id="organizationMemberOfName">n/a</span> <span id="organizationMemberOfWord">depuis/:</span> <span id="organizationMemberStartDate">n/a</span><span id="organizationMemberEndDateData"> – <span id="organizationMemberEndDate">n/a</span></span> (<span id="organizationMemberAge">n/a</span>)</div>
|
<div>Membre <span id="organizationMemberOfName">n/a</span> <span id="organizationMemberOfWord">depuis/:</span> <span id="organizationMemberStartDate">n/a</span><span id="organizationMemberEndDateData"> – <span id="organizationMemberEndDate">n/a</span></span> (<span id="organizationMemberAge">n/a</span>)</div>
|
||||||
<div class="content_infos" style="margin: 5px;">
|
<div class="content_infos" style="margin: 5px;">
|
||||||
Liens :
|
Liens :
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<p id="serviceDescription" class="center_table" style="width: 500px;">Description absente…</p>
|
<p id="serviceDescription" class="center_table" style="width: 500px;">Description absente…</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div><span id="serviceStartDateWord">Depuis</span> <span id="serviceStartDate">n/a</span><span id="serviceEndDateData"> – <span id="serviceEndDate">n/a</span></span>   Statut : <img id="serviceStatusImg" src="status-void.png" style="width: 25px; vertical-align: bottom;" /></div>
|
<div><span id="serviceStartDateWord">Depuis</span> <span id="serviceStartDate">n/a</span><span id="serviceEndDateData"> – <span id="serviceEndDate">n/a</span></span> (<span id="serviceAge">n/a</span>)   Statut : <img id="serviceStatusImg" src="status-void.png" style="width: 25px; vertical-align: bottom;" /></div>
|
||||||
<div class="content_infos" style="border: 0px solid blue; border-radius: 8px; margin: 5px;">
|
<div class="content_infos" style="border: 0px solid blue; border-radius: 8px; margin: 5px;">
|
||||||
Inscription :
|
Inscription :
|
||||||
<img id="registrationNoneImg" src="circle-icons/global-mono.svg" class="disabled" title="Sans compte"/>
|
<img id="registrationNoneImg" src="circle-icons/global-mono.svg" class="disabled" title="Sans compte"/>
|
||||||
|
|
Loading…
Reference in a new issue