fix: wrong month display in calendars
This commit is contained in:
@@ -89,7 +89,7 @@ onRender((ctx) => {
|
|||||||
ctx.font = "10px NDS10";
|
ctx.font = "10px NDS10";
|
||||||
ctx.letterSpacing = "2px";
|
ctx.letterSpacing = "2px";
|
||||||
|
|
||||||
const timeText = `${month}/${year}`;
|
const timeText = `${(month + 1).toString().padStart(2, "0")}/${year}`;
|
||||||
const { actualBoundingBoxRight: width } = ctx.measureText(timeText);
|
const { actualBoundingBoxRight: width } = ctx.measureText(timeText);
|
||||||
|
|
||||||
ctx.fillText(
|
ctx.fillText(
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ onRender((ctx) => {
|
|||||||
ctx.font = "10px NDS10";
|
ctx.font = "10px NDS10";
|
||||||
ctx.letterSpacing = "2px";
|
ctx.letterSpacing = "2px";
|
||||||
|
|
||||||
const timeText = `${month}/${year}`;
|
const timeText = `${(month + 1).toString().padStart(2, "0")}/${year}`;
|
||||||
const { actualBoundingBoxRight: width } = ctx.measureText(timeText);
|
const { actualBoundingBoxRight: width } = ctx.measureText(timeText);
|
||||||
|
|
||||||
ctx.fillText(
|
ctx.fillText(
|
||||||
|
|||||||
Reference in New Issue
Block a user