Skip to content

Commit 84f603b

Browse files
committed
Fix for issued and due dates with large month names
1 parent 7cb3f33 commit 84f603b

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/core/report.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,22 +138,18 @@ class Report {
138138
#generateDatesInfo() {
139139
const { configuration } = this.#invoice;
140140
const locale = configuration?.locale || DEFAULT_LOCALE;
141-
const options: TextOptionsLight = { align: 'right' };
141+
const options: TextOptionsLight = { align: 'left' };
142142
const halfHeight = this.#doc.height / 2;
143143

144144
this.#doc
145145
.focusPage(1)
146146
.setFont({ weight: 'normal' })
147-
.setXY(126, halfHeight - 40);
148-
this.#doc.writeText('Issued on:', options);
149-
this.#doc.setXY(150);
150-
this.#doc.breakText(formatNamedDate(this.#date, locale), options);
147+
.setXY(110, halfHeight - 50);
148+
this.#doc.breakText(`Issued on: ${formatNamedDate(this.#date, locale)}`, options);
151149

152150
if (this.#dueOn) {
153-
this.#doc.setXY(126);
154-
this.#doc.writeText('Due on:', options);
155-
this.#doc.setXY(150);
156-
this.#doc.breakText(formatNamedDate(this.#dueOn, locale), options);
151+
this.#doc.setXY(110);
152+
this.#doc.breakText(`Due on: ${formatNamedDate(this.#dueOn, locale)}`, options);
157153
}
158154
}
159155

0 commit comments

Comments
 (0)