In the future, I would recommend you enclose any snippets of relevance in the tic marks (back-quote). This prevents the introduction of “Smart Quotes” in your post. You can do so by choosing the Preformatted text button (</>). Also, it would help everyone help you, if you would post samples of your registry values.
So, if I understand your business logic, the relevance should evaluate to “yes” when the following conditions are met:
- Current time of the client is inside the time period represented by the content of the registry values WindowStart & WindowEnd:
Test for start of Window: ... time current_time_of_day >= item 3 of it ...
Test for end of Window test: ... time current_time_of_day < item 4 of it ...
These comparisons will be made using hh:mm:ss
You also check when the combination of month names, week numbers (1-4), and day names present in other registry values match the current date.
You check again to see if the current time is before the end of the window. It appears to me that this last test is redundant and overly complicated, since it uses hh:mm, and ignores seconds.
What business rule are you implementing with this code? Do you meet your requirements still if you remove test 3?
I have other questions about the complexity of your relevance, but let’s stick to the issue you raised above.