-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTrigger.js
55 lines (45 loc) · 1.14 KB
/
Trigger.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//DEPRECATED: don't use anything from this class
var Trigger = function(){}
Trigger.getRandomArbitrary = function(min, max) {
return Trellinator.getRandomArbitrary(min,max);
}
Trigger.now = function()
{
return Trellinator.now();
}
Trigger.isWeekDay = function(date)
{
//return !((date.getDay() == 6) || (date.getDay() == 0));
return date.isWeekDay();
}
//time given in 24 hour time with no seconds like 14:34
Trigger.xOclockTomorrow = function(time24)
{
var time_parts = time24.split(":");
var ret = new Date();
ret.setDate(ret.getDate() + 1);
ret.setHours(time_parts[0]);
ret.setMinutes(time_parts[1]);
ret.setMilliseconds(0);
return ret;
}
//time given in 24 hour time with no seconds like 14:34
Trigger.timeIsBetween = function(start,finish)
{
return Trellinator.now().timeIsBetween(start,finish);
}
Trigger.xHoursFromNow = function(x)
{
return Trigger.now().addHours(x);
}
Trigger.xMinutesFromNow = function(x)
{
return Trigger.now().addMinutes(x);
}
Trigger.xDaysFromNow = function(x,time)
{
var date = Trigger.now().addDays(x);
if(time)
date.at(time);
return date;
}