412
Views
4
Comments
Inputs with start date and end date of the current year

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?

UserImage.jpg
vikas sharma
Champion

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))


2022-07-03 17-24-08
Sourabh sharma

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.

2020-06-27 18-35-53
Rohan Hanumante

Hi,

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)


hope that will help.


2022-07-03 17-24-08
Sourabh sharma


Hi  Yadanar Moe Min ,

you can do with JS also ...

Try Demo Here



Kind regards.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.