Question

How to select a future date in a datepicker, where the text box is disabled(Read only field).The calendar has a drop downs for the months and years?

  • 9 September 2022
  • 9 replies
  • 204 views

Badge +4
How to select a future date in a datepicker, where the text box is disabled(Read only field).The calendar has a drop downs for the months and years?

9 replies

Hi Lesley,

 

You will have to create a custom domxpath by understand the datepicker pattern.

 

If you do not know how to work with custom domxpath, I would suggest you to check this article, it will help you.

 

Thanks

Badge +4

@Ikshit Dhawan​ Please see the below image of the calendar, with regards to the custom domxpath how I will select a future date, that must be current system:date + 30 days?Will I need a While and If statement so that it may loop for 30 days?

 

@Tebogo Moloto​ , I am sorry but you missed to upload an image

Badge +4

@Ikshit Dhawan​ Please find attached image of calendar

Badge +4

@Ikshit Dhawan​ The below image is how my loop looks like

Badge +4

@Ikshit Dhawan​ I was able to add the current date plus 30 days to the innerhtml which works however how will I be able to make sure the month and year is also catered for when it comes to adding the 30 days, do I need to use a while condition look at the current month and year?

Badge +4

The below image is how my loop looks like

No, To add 30 days, use DateTime Package Add > 30 days and save it into a variable (assuming you created datetime variable as 30PlusDays)

Then Use To String Action from DateTime Package > Source Date will be 30PlusDays and Custom Format MMMM (it should be caps 4 times MMMM) will give you full month name (like October)

Using this value you can choose the month, similarly you can get the year and day value and select those values in the picker

Check this article - https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/aae-client/bot-creator/commands/cloud-date-time-formats.html/p>

Reply