Skip to content
Snippets Groups Projects
Commit d0408b3e authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#400 - show date with month name and year + center

parent 9f3229fe
Branches
Tags
No related merge requests found
...@@ -6,7 +6,8 @@ public enum DateFormatStyle ...@@ -6,7 +6,8 @@ public enum DateFormatStyle
NO_YEAR("dd.MM."), NO_YEAR("dd.MM."),
LONG("dd.MM.yyyy"), LONG("dd.MM.yyyy"),
LONG_MONTH_AND_YEAR("MMMM yyyy"), LONG_MONTH_AND_YEAR("MMMM yyyy"),
DATE_TIME("dd.MM.yyyy HH:mm"); DATE_TIME("dd.MM.yyyy HH:mm"),
LONG_WITH_MONTH_NAME("dd. MMMM yyyy");
private final String key; private final String key;
......
...@@ -44,6 +44,11 @@ public class DateService ...@@ -44,6 +44,11 @@ public class DateService
return getDateString(date, DateFormatStyle.DATE_TIME); return getDateString(date, DateFormatStyle.DATE_TIME);
} }
public String getDateStringWithMonthName(LocalDate date)
{
return getDateString(date, DateFormatStyle.LONG_WITH_MONTH_NAME);
}
private String getDateString(LocalDate date, DateFormatStyle formatStyle) private String getDateString(LocalDate date, DateFormatStyle formatStyle)
{ {
return date.format(DateTimeFormatter.ofPattern(formatStyle.getKey()).withLocale(settingsService.getSettings().getLanguage().getLocale())); return date.format(DateTimeFormatter.ofPattern(formatStyle.getKey()).withLocale(settingsService.getSettings().getLanguage().getLocale()));
......
...@@ -76,10 +76,14 @@ ...@@ -76,10 +76,14 @@
min-width: 5.5rem; min-width: 5.5rem;
margin-top: 1.6rem; margin-top: 1.6rem;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
color: #FFFFFFDD;
letter-spacing: 0.1rem;
} }
.search-result .transaction-date { .search-result .transaction-date {
margin: 0; margin: 0;
color: var(--color-text);
letter-spacing: normal;
} }
.new-transaction-button { .new-transaction-button {
......
...@@ -55,13 +55,13 @@ ...@@ -55,13 +55,13 @@
<#list transactions as transaction> <#list transactions as transaction>
<#assign shouldHighlight = highlightID?? && transaction.getID()?? && transaction.getID()==highlightID/> <#assign shouldHighlight = highlightID?? && transaction.getID()?? && transaction.getID()==highlightID/>
<#assign transactionDate=dateService.getDateStringWithoutYear(transaction.date)/> <#assign transactionDate=dateService.getDateStringWithMonthName(transaction.date)?upper_case/>
<#if transactionDate != lastDate> <#if transactionDate != lastDate>
<#if !transaction?is_first> <#if !transaction?is_first>
</div> <#-- close "transaction-date-group" div from previous loop iteration --> </div> <#-- close "transaction-date-group" div from previous loop iteration -->
</#if> </#if>
<div class="transaction-date-group"> <div class="transaction-date-group">
<div class="col s12 left-align bold transaction-text transaction-date"> <div class="col s12 center-align bold transaction-text transaction-date">
${transactionDate} ${transactionDate}
</div> </div>
<#assign lastDate=transactionDate/> <#assign lastDate=transactionDate/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment