Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add New Year's Eve to German Calendar #1080

Merged
merged 2 commits into from Jan 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -658,7 +658,7 @@ private void updateChart()

yAxis1st.getTick().setVisible(true);

if (chartConfig.contains(ChartDetails.SHOW_MISSING_TRADING_DAYS))
if (chartConfig.contains(ChartDetails.SHOW_MISSING_TRADING_DAYS) && security.getCalendar() != "empty") //$NON-NLS-1$
{
TradeCalendar tradeCalendar = TradeCalendarManager.getInstance(security);
List<LocalDate> calendarDates = new ArrayList<>();
Expand Down
Expand Up @@ -134,6 +134,7 @@ public class Messages extends NLS
public static String LabelTradeCalendarLSE;
public static String LabelTradeCalendarNYSE;
public static String LabelTradeCalendarUseDefault;
public static String LabelTradeCalendarEmpty;
public static String LabelTransferAccount;
public static String LabelTransferPortfolio;
public static String LabelWithoutClassification;
Expand Down
Expand Up @@ -257,6 +257,8 @@ LabelTradeCalendarNYSE = New York Stock Exchange

LabelTradeCalendarUseDefault = ( Use globally configured calendar: {0} )

LabelTradeCalendarEmpty = ( None )

LabelTransferAccount = Transfer (Account)

LabelTransferPortfolio = Transfer (Portfolio)
Expand Down
Expand Up @@ -251,6 +251,8 @@ LabelTradeCalendarGermany = Deutschland

LabelTradeCalendarUseDefault = ( Global konfigurierten Kalendar nutzen: {0} )

LabelTradeCalendarEmpty = ( Keiner )

LabelTransferAccount = Umbuchung (Konto)

LabelTransferPortfolio = Umbuchung (Portfolio)
Expand Down
Expand Up @@ -5,9 +5,11 @@

/* package */ enum HolidayName
{
BANK_HOLIDAY, BOXING_DAY,
BANK_HOLIDAY,
BOXING_DAY,
CHRISTMAS,
CHRISTMAS_EVE,
NEW_YEARS_EVE,
EASTER_MONDAY,
FIRST_CHRISTMAS_DAY,
FUNERAL_OF_PRESIDENT_REAGAN,
Expand Down
Expand Up @@ -4,6 +4,7 @@
import static name.abuchen.portfolio.util.HolidayName.BOXING_DAY;
import static name.abuchen.portfolio.util.HolidayName.CHRISTMAS;
import static name.abuchen.portfolio.util.HolidayName.CHRISTMAS_EVE;
import static name.abuchen.portfolio.util.HolidayName.NEW_YEARS_EVE;
import static name.abuchen.portfolio.util.HolidayName.EASTER_MONDAY;
import static name.abuchen.portfolio.util.HolidayName.FIRST_CHRISTMAS_DAY;
import static name.abuchen.portfolio.util.HolidayName.FUNERAL_OF_PRESIDENT_REAGAN;
Expand Down Expand Up @@ -64,6 +65,7 @@ public class TradeCalendarManager
tc.add(fixed(CHRISTMAS_EVE, Month.DECEMBER, 24));
tc.add(fixed(FIRST_CHRISTMAS_DAY, Month.DECEMBER, 25));
tc.add(fixed(SECOND_CHRISTMAS_DAY, Month.DECEMBER, 26));
tc.add(fixed(NEW_YEARS_EVE, Month.DECEMBER, 31));
CACHE.put(tc.getCode(), tc);

tc = new TradeCalendar("nyse", Messages.LabelTradeCalendarNYSE); //$NON-NLS-1$
Expand Down Expand Up @@ -101,7 +103,10 @@ public class TradeCalendarManager
tc.add(fixed(FIRST_CHRISTMAS_DAY, Month.DECEMBER, 25));
tc.add(fixed(BOXING_DAY, Month.DECEMBER, 26));
CACHE.put(tc.getCode(), tc);
}

tc = new TradeCalendar("empty", Messages.LabelTradeCalendarEmpty); //$NON-NLS-1$
CACHE.put(tc.getCode(), tc);
}

private TradeCalendarManager()
{
Expand Down
Expand Up @@ -7,6 +7,8 @@ CHRISTMAS = Christmas

CHRISTMAS_EVE = Christmas Eve

NEW_YEARS_EVE = New Year's Eve

EASTER_MONDAY = Easter Monday

FIRST_CHRISTMAS_DAY = 1st Christmas Day
Expand Down
Expand Up @@ -7,6 +7,8 @@ CHRISTMAS = Weihnachten

CHRISTMAS_EVE = Heiligabend

NEW_YEARS_EVE = Silvester

EASTER_MONDAY = Ostermontag

FIRST_CHRISTMAS_DAY = 1. Weihnachtsfeiertag
Expand Down