Hi all, I have some difficulty to retrieve the start date and end date of the current year. I want to show the situation of the current year, that is, I would like the inputs "FromDate" and "ToDate" to be filled respectively in the date range with the first day of January and last day of December of current year. Could you guys please help me with that?
Hi,
So first date of year will be always 1 Jan and last date of year will be always 31 Dec. For your requirement you can get the current Year then build a new date for 1 Jan and 31 Dec respectively.
Use Year(dt) method to get the current year :
User newDate(y m d) to create new date
ex : NewDate(year value return by last method, 1 (for Jan), 1 (for Jan))
Hi Ei Yadanar Moe Min
Same discussion held in the given link below ! kind visit this hope this will help you.
https://www.outsystems.com/forums/discussion/52522/inputs-with-start-date-and-end-date-of-the-current-month/
if didn't plz let us know..
Kind Regards.
OnInitialize event you can Assign the StartDate local variable as mentioned below and bind this local variable to Start Date input same logic can be used to get Last date of the current year.
Or As mentioned by Vikas you can bind the
FromDate to NewDate(Year(CurrDate()), 1,1) and ToDate to NewDate(Year(CurrDate()), 12, 31)
Hi Yadanar Moe Min ,
you can do with JS also ...
Try Demo Here
Kind regards.