Work days, Weekends and Controlling of Holidays?

Hi all,

i want to control of the weekends, work week or days and holidays.
How can i do that ?
If user enters a weekend day or private day, the system should be say “this day is holiday or smt”

Thanks.

Hello @yigit.aybey

Do you mean on that particular day you dont need to execute the script?
If yes you can create the holiday calendar in orchestrator, if you are executing from orchestrator.

check the below doc:
If the requirement is something different plz explain.

I’m not using orchestrator at the moment. I’m new in UiPath platform.
User entering this format : dd.MM.yyyy and i’m controlling this work days fine right now but user cannot know which day is holiday and private day.

I do not have this feature

So is it a UiPath app? Or user is entering date in some other application?

If you are talking about applciation level validations, it needs to be done within the application itself.

Uipath will help you to automate the repetitive process and it cannot control the application level date validation.

I have a input dialog and if user enters this : 28.05.2022 the system should say “you entered weekend or holiday” smt. By the way, i’m keeping this data in a variable as a string.

i need smt like assign : str_weekend = dateTime.Weekend (I’m randomizing) or smt different

@yigit.aybey ,

Basically, I would say you would need to keep a List of Holidays, and What are the weekends to be considered as per your Country/Region in array/List variables.

After the User Enters the Date, we can then Check with these lists if the date is present in the Holiday list or the weekend list. Then we can Declare that the Given Date is a Holiday/Weekend.

How to create a list? i mean i cannot check every month which day is weekend or not.

Hi @yigit.aybey,

It’s unlikely that you can control this on the orchestrator schedule because holidays vary by country.

My suggestion is to plan the process as weekdays and check whether that day is a holiday during the process. To do this, you can create an excel template. The robot goes to that template every time it works and continues working after confirming that that day is not a holiday.

Regards,
MY

@yigit.aybey , The Weekend Logic can be handled by the Date Time methods, Provided we would know what days are to be considered as weekends.

But the holiday date list needs to be added by us/human as we do not have a particular method for handling this, atleast not in a straight forward method.

Of course i can control this method with if statements or as you said like doing list method.

I’m not using orchestrator. I’m just using UiPath Platform

Do you know which date.Time method should i use. i mean date.time.thisMonth.weekends or smt like. Is there any kind of code?

@yigit.aybey , Suppose the User enters the Date as "04/06/2022".

We can use the Below Expression to Check if it is a Weekend or not :

weekendList.Any(Function(x)x.Equals(DateTime.ParseExact("04/06/2022","dd/MM/yyyy",System.Globalization.CultureInfo.InvariantCulture).DayOfWeek.ToString))

Here, weekendList is a Array of String variable which consists the weekend day names.

It would be better to restrict the user to put the date in a particular format and then use the format in the DateTime.ParseExact method.

More on DateTime you can find below :

I need 17th but i cannot use 3rd partions or smt. If the packet is in the manage packet and if i can find there is ok, otherwise i cannot use. :frowning:

This is what i want. This is c# code.

ee

I tried to converting the code but there is no such thing “dayofweek.saturday” in V.B

@yigit.aybey ,

The above implementation is to Check for Weekends and not for Holidays.
This implementation is the same as provided in my above post.

Have you tried testing it ?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.