if
(
if current date <
(
first sunday of current month_and_year
)
then "0" else if current date >=
(
first sunday of current month_and_year
)
and current date <
(
(
first sunday of current month_and_year
)
+
(
7*day
)
)
then "1" else if current date >=
(
(
first sunday of current month_and_year
)
+
(
7*day
)
)
and current date <
(
(
first sunday of current month_and_year
)
+
(
14*day
)
)
then "2" else if current date >=
(
(
first sunday of current month_and_year
)
+
(
14*day
)
)
and current date <
(
(
first sunday of current month_and_year
)
+
(
21*day
)
)
then "3" else if current date >=
(
(
first sunday of current month_and_year
)
+
(
21*day
)
)
and current date <
(
(
first sunday of current month_and_year
)
+
(
28*day
)
)
then "4" else if current date >=
(
(
first sunday of current month_and_year
)
+
(
28*day
)
)
then "5" else "Undefined"
)
=
(
if exist values of settings "Patch Week" of client then value of setting "Patch Week" of client else error "not set"
)
and day_of_week of current date as string =
(
if exist values of settings "Patch Day" of client then value of setting "Patch Day" of client else error "not set"
)
and
(
(
two digit hour of it as string & two digit minute of it as string
)
of time
(
local time zone
)
of it
)
of now >=
(
if exist values of settings "Patch Start Time" of client then value of setting "Patch Start Time" of client else error "not set"
)
and
(
(
two digit hour of it as string & two digit minute of it as string
)
of time
(
local time zone
)
of it
)
of now <=
(
if exist values of settings "Patch End Time" of client then value of setting "Patch End Time" of client else error "not set"
)
then True else False
if (if current date < (first sunday of current month_and_year) then "0" else if current date >= (first sunday of current month_and_year) and current date < ((first sunday of current month_and_year) + (7*day)) then "1" else if current date >= ((first sunday of current month_and_year) + (7*day)) and current date < ((first sunday of current month_and_year) + (14*day)) then "2" else if current date >= ((first sunday of current month_and_year) + (14*day)) and current date < ((first sunday of current month_and_year) + (21*day)) then "3" else if current date >= ((first sunday of current month_and_year) + (21*day)) and current date < ((first sunday of current month_and_year) + (28*day)) then "4" else if current date >= ((first sunday of current month_and_year) + (28*day)) then "5" else "Undefined") = (if exist values of settings "Patch Week" of client then value of setting "Patch Week" of client else error "not set") and day_of_week of current date as string = (if exist values of settings "Patch Day" of client then value of setting "Patch Day" of client else error "not set") and ((two digit hour of it as string & two digit minute of it as string) of time (local time zone) of it) of now >= (if exist values of settings "Patch Start Time" of client then value of setting "Patch Start Time" of client else error "not set") and ((two digit hour of it as string & two digit minute of it as string) of time (local time zone) of it) of now <= (if exist values of settings "Patch End Time" of client then value of setting "Patch End Time" of client else error "not set") then True else False