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

moved getCurrentDate to DateService

parent 279b00c3
No related branches found
No related tags found
1 merge request!229Feature/index page
Pipeline #2235 failed
...@@ -53,4 +53,9 @@ public class DateService ...@@ -53,4 +53,9 @@ public class DateService
return DateTime.parse(cookieDate, DateTimeFormat.forPattern("dd.MM.yy").withLocale(settingsService.getSettings().getLanguage().getLocale())); return DateTime.parse(cookieDate, DateTimeFormat.forPattern("dd.MM.yy").withLocale(settingsService.getSettings().getLanguage().getLocale()));
} }
} }
public DateTime getCurrentDate()
{
return DateTime.now();
}
} }
...@@ -12,18 +12,15 @@ import de.deadlocker8.budgetmaster.filter.FilterConfiguration; ...@@ -12,18 +12,15 @@ import de.deadlocker8.budgetmaster.filter.FilterConfiguration;
import de.deadlocker8.budgetmaster.repeating.modifier.RepeatingModifierType; import de.deadlocker8.budgetmaster.repeating.modifier.RepeatingModifierType;
import de.deadlocker8.budgetmaster.reports.Budget; import de.deadlocker8.budgetmaster.reports.Budget;
import de.deadlocker8.budgetmaster.settings.Settings; import de.deadlocker8.budgetmaster.settings.Settings;
import de.deadlocker8.budgetmaster.settings.SettingsRepository;
import de.deadlocker8.budgetmaster.settings.SettingsService; import de.deadlocker8.budgetmaster.settings.SettingsService;
import de.deadlocker8.budgetmaster.tags.Tag; import de.deadlocker8.budgetmaster.tags.Tag;
import de.deadlocker8.budgetmaster.tags.TagRepository; import de.deadlocker8.budgetmaster.tags.TagRepository;
import de.deadlocker8.budgetmaster.transactions.Transaction; import de.deadlocker8.budgetmaster.transactions.Transaction;
import de.deadlocker8.budgetmaster.transactions.TransactionService; import de.deadlocker8.budgetmaster.transactions.TransactionService;
import de.deadlocker8.budgetmaster.update.BudgetMasterUpdateService;
import de.deadlocker8.budgetmaster.utils.Colors; import de.deadlocker8.budgetmaster.utils.Colors;
import de.deadlocker8.budgetmaster.utils.LanguageType; import de.deadlocker8.budgetmaster.utils.LanguageType;
import de.thecodelabs.utils.util.ColorUtilsNonJavaFX; import de.thecodelabs.utils.util.ColorUtilsNonJavaFX;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -36,9 +33,6 @@ import java.util.List; ...@@ -36,9 +33,6 @@ import java.util.List;
@Service @Service
public class HelpersService public class HelpersService
{ {
@Autowired
private SettingsRepository settingsRepository;
@Autowired @Autowired
private SettingsService settingsService; private SettingsService settingsService;
...@@ -176,15 +170,10 @@ public class HelpersService ...@@ -176,15 +170,10 @@ public class HelpersService
return transaction.getAmount(); return transaction.getAmount();
} }
public DateTime getCurrentDate()
{
return DateTime.now();
}
public int getAccountBudget() public int getAccountBudget()
{ {
Account currentAccount = getCurrentAccount(); Account currentAccount = getCurrentAccount();
List<Transaction> transactions = transactionService.getTransactionsForAccountUntilDate(currentAccount, getCurrentDate(), FilterConfiguration.DEFAULT); List<Transaction> transactions = transactionService.getTransactionsForAccountUntilDate(currentAccount, DateTime.now(), FilterConfiguration.DEFAULT);
int sum = 0; int sum = 0;
for(Transaction transaction : transactions) for(Transaction transaction : transactions)
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<#else> <#else>
<div class="account-budget ${greenTextColor}">${currencyService.getCurrencyString(accountBudget)}</div> <div class="account-budget ${greenTextColor}">${currencyService.getCurrencyString(accountBudget)}</div>
</#if> </#if>
<div class="account-budget-date text-color">(${locale.getString("account.budget.asof")}: ${dateService.getDateStringNormal(helpers.getCurrentDate())})</div> <div class="account-budget-date text-color">(${locale.getString("account.budget.asof")}: ${dateService.getDateStringNormal(dateService.getCurrentDate())})</div>
</div> </div>
</#macro> </#macro>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment