From 2e036ba5479c9c805e263a40f121238d9cc974f2 Mon Sep 17 00:00:00 2001 From: Starfall Date: Mon, 16 Oct 2023 15:06:28 -0500 Subject: fix off by one --- js/moon-phase.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/moon-phase.js b/js/moon-phase.js index 9554597..a8a3bae 100644 --- a/js/moon-phase.js +++ b/js/moon-phase.js @@ -31,13 +31,13 @@ function getMoonsString(date) { str = str.concat('\u2500'.repeat(next_four_phases[0] - date)) .concat(icons[next_phase % 4]) - .concat('\u2500'.repeat(next_four_phases[1] - next_four_phases[0])) + .concat('\u2500'.repeat(next_four_phases[1] - next_four_phases[0] - 1)) .concat(icons[(next_phase + 1) % 4]) - .concat('\u2500'.repeat(next_four_phases[2] - next_four_phases[1])) + .concat('\u2500'.repeat(next_four_phases[2] - next_four_phases[1] - 1)) .concat(icons[(next_phase + 2) % 4]) - .concat('\u2500'.repeat(next_four_phases[3] - next_four_phases[2])) + .concat('\u2500'.repeat(next_four_phases[3] - next_four_phases[2] - 1)) .concat(icons[(next_phase + 3) % 4]) return str -- cgit