[RESOLVED] Month Restriction


#1

Currently you can add restrictions for date/time but it requires a year. It would be great if we could have a restriction by just month. (i.e. I want the piston to run in December for my Christmas lights, or on October for my Halloween lights)


#2

I like this idea


#3

It’s not the built in one you’re looking for but in a bind you can do:

Expression: {$month} is equal to 12 (or not)


#4

Pretty sure it’s built in :wink:


#5

The easier way to input the expression would be

$month == 3

This would then be evaluated as true this month and would require no specific time definition.


#6

{$month == 3} IS True

Is less efficient than:

{$month} IS 3

And if you want to restrict to multiple months then this would be more efficient:

{$month} IS {3 | 5 | 8}


#7

This one worked well…


#8

So, in this example:
image

The first is more efficent than the second? Also, If I wanted a list for the first, I would input like this?

For some reason the expression here is evaluating to 15. Why is that?


#9

Hmmm… I’m actually not sure why that equates wrong…

But try this instead:

image


#11

Thanks, cause I wouldn’t have come up with that if I’d tried for a millenia. LOL You da :bomb:. :smile:


#12

To be honest I’m not entirely sure how that one works either lol… the matches() function isn’t on the wiki but @ipaterson mentioned it in another post the other day.

I get the overall syntax but I have no idea what the /‘s are for lol… the expression doesn’t work without them whatever they do!

If I find out I’ll update the wiki.


#13

Ours is not to reason why, ours is but to do and die (of frustration).
-Tennyson


#14

It probably follows how most regular expressions are formatted. I know at least using awk & sed they use the same thing. Even the vi editor uses them too