Hi Guys!
I need to calculate the last days of the month of the current year. I have a screen that registers deadlines for registering vacations in the month, based on this information I want to get the last date of each month in this register. Jan last day Feb last day ...
Has anyone needed it or know how to do it?
Hi Fabiano,
This Forge component has the right function to do that and many others.
https://www.outsystems.com/forge/component-overview/9759/date-time-utils
Regards,
Daniel
In my case, the company's project does not allow installing plugins, I had even seen this solution in another group
You can install the forge component in your PE. Inspect the code, and code the same.
Stupid company rules btw.
I open it here in my personal and it will be useful for other functions that I will create, but I agree with the fact that the company does not want to use plugins.
If you want to calculate yourself, just substract 1 day of the first day of the next month
is there any way to get different months in case Jan, Feb, Apr, Mar... ?
Well, if you want to get it for every month of a given year (variable DesiredYear) just iterate a variable MonthCounter from 1 to 12, and do something like
AddDays(AddMonths(NewDate(DesiredYear, MonthCounter, 1),1), -1)
ok, i will try to implement here
Hello Fabiano,
Did you check this forum post? @Daniel Kuhlmann there suggested a way of doing it :)
Best regards,
Ana
I would have to implement it for each month of the year
Olá Fabiano, para obter o último dia do mês, pode fazer assim: AddDays(AddMonths(CurrDate(), 1), -Day(AddMonths(CurrDate(), 1)))
Aonde CurrDate é a data atual. Pode substituir pela sua variável ou parâmetro de entrada.