Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
outside working hours.
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
Copy link

@jan
I see my mistake now. Thank you sir, much apperciated.

@jan
Copy link

jan commented Sep 25, 2019

@HungryHowies wasn‘t me.

@HungryHowies
Copy link

HungryHowies commented Oct 9, 2019

@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