You can create your dates using a for loop
$day = new Date().getDate(); // e.g. 14
for (i = 1; i <= $day; i++) {
console.log(new Date().setDate($i)):
}
Obviously you need to do something other than console.log thd date bug should help.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi All,
i am using chartjs, i want to put the dates of the month on the label. and show the records of those dates. for example today is 14, i want to put date from october 1 to october 14, then tomorrow it will be to october 15.
can any one help me on how to accomplish this?. I am searching for 2 days now.
Thanks,
@pordonez - the code provided is JavaScript so shouldn't be in your controller, you would put it in your view.
Can you share you code?
Please or to participate in this conversation.