nico
December 25, 2023, 6:00pm
1
Hello.
Do you know how can I get the total days in a month or total days in current month using Date Plugin?
In Day.js website I found this but I don’t know how to apply it in WeWeb
https://day.js.org/docs/en/display/days-in-month
Thank you for your help!
You can use some code
const numDays = (y, m) => new Date(y, m, 0).getDate();
console.log(numDays(2020, 2));
1 Like
Joyce
December 26, 2023, 1:36pm
3
Hi @nico
Great question! I’ll ask the team if we can add the daysInMonth
formula in no-code.
In the meantime, @jaredgibb ’s tip will work.
You could add it as a reusable formula in the Actions
tab:
And then use it in different places in your project:
1 Like
nico
December 26, 2023, 3:27pm
4
Thank you! @Joyce & @jaredgibb you’re amazing! I’ll use this solution.
Include daysInMonth formula in no-code will be great!
1 Like
nico
December 26, 2023, 5:33pm
5
jaredgibb:
const numDays = (y, m) => new Date(y, m, 0).getDate();
console.log(numDays(2020, 2));
@Joyce @jaredgibb
Works Perfect!
Now I can add the last date of current month as Due Date to my Xano Quote/Estimation table.
1 Like