Created
September 23, 2019 13:53
-
-
Save jalogisch/72455fc830d6e0ab41f0c6aacb1c2bb9 to your computer and use it in GitHub Desktop.
outside working hours.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rule "off work hours" | |
when | |
( to_long(to_date($message.timestamp, "Asia/Manila").hourOfDay) >= 0 AND to_long(to_date($message.timestamp, "Asia/Manila").hourOfDay) <= 6 ) OR | |
( to_long(to_date($message.timestamp, "Asia/Manila").hourOfDay) >= 18 AND to_long(to_date($message.timestamp, "Asia/Manila").hourOfDay) <= 0 ) | |
then | |
set_field("trigger_workhours_off", true); | |
end | |
rule "off work weekend" | |
when | |
// from Monday (1) to Sunday (7) | |
to_long(to_date($message.timestamp, "Asia/Manila").dayOfWeek) == 7 OR | |
to_long(to_date($message.timestamp, "Asia/Manila").dayOfWeek) == 6 | |
then | |
set_field("trigger_workhours_off", true); | |
end |
@HungryHowies wasn‘t me.
@jan
Whom ever it was that did this I would Like to say thanks, it has been working exceptionally well. I did make some configuration to support my own needs, but was a great start.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jan
I see my mistake now. Thank you sir, much apperciated.