From 290d8fbcfd32c0dc18c0af134aa407856566b8df Mon Sep 17 00:00:00 2001 From: John McCardle Date: Fri, 14 Jan 2022 14:59:12 -0500 Subject: [PATCH] feat: display a month before negative years ; closes #92 --- store/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/store/index.js b/store/index.js index 23d5a01..1cffc34 100644 --- a/store/index.js +++ b/store/index.js @@ -592,6 +592,7 @@ export const getters = { return state.playerAge.month < state.playerAgeMax.month }, gameMonth: (state) => { + const gd = state.gameDate < 0 ? state.gameDate + 1440000 : state.gameDate return { 1: 'Jan.', 2: 'Feb.', @@ -605,7 +606,7 @@ export const getters = { 10: 'Oct.', 11: 'Nov.', 12: 'Dec.', - }[(state.gameDate % 12) + 1] + }[(gd % 12) + 1] }, gameYear: (state) => { return Math.floor(state.gameDate / 12)