How to determine "Not Weekend"?

  • Автор темы Автор темы Cyrix
  • Дата начала Дата начала

Cyrix

Client
Регистрация
16.12.2011
Сообщения
401
Реакции
12
Баллы
18
I want to run something only on weekdays.
I have the following If action but it's not working:

{-TimeNow.DayOfWeek-}!='Saturday' && {-TimeNow.DayOfWeek-}!='Sunday'

For example, today is Wednesday, and the above action should give a True, but in fact it gives False, on ZP 7.x.

Is there something wrong with the logic?
Thanks.
 
I want to run something only on weekdays.
I have the following If action but it's not working:

{-TimeNow.DayOfWeek-}!='Saturday' && {-TimeNow.DayOfWeek-}!='Sunday'

For example, today is Wednesday, and the above action should give a True, but in fact it gives False, on ZP 7.x.

Is there something wrong with the logic?
Thanks.
This is because you comparing date format value with text string.
Better make it on C#, check the example:
 
  • Спасибо
Реакции: Cyrix
This is because you comparing date format value with text string.
Better make it on C#, check the example:
I was thinking the same, but if you do just one value, it works. "{-TimeNow.DayOfWeek-}!='Saturday' " so i guess it has something to do with && operator there. BTW shouldn't all those variables starting with {- be a string, anyway?
 
  • Спасибо
Реакции: Cyrix
  • Спасибо
Реакции: Cyrix и lokiys
Thanks for the info. I will be using ||.
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)