I have a screen where users can select a start date and an end date from date pickers to filter out data ranging from start to end . I dont want to allow users to select a range greater than two years.(Not more than 2 years span) eg. JAN 2015 till JAN 2017 / Mar 2019 till Mar 2021 --- valid date ranges if user selects start date as JAN 2015 and end date as JAN 2019 it should throw an error “Date range must be within 2 years span”. Can someone please help, there are many date format functions which one to use ?
you can use calendar years between to find the difference between the years