-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImsakSetting.js
80 lines (64 loc) · 1.69 KB
/
ImsakSetting.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* ----< Copyright Block >----
*
* Prayer Times Calculator
* ImsakSetting.js
* Copyright (C) 2015
* Mohsen Izadi <[email protected]>
*
* Based On:
* PrayTimes.js (v2.3)
* Copyright (C) 2007-2011 PrayTimes.org
* Hamid Zarrabi-Zadeh
*
* License: GNU LGPL v3.0
*
* TERMS OF USE:
* Permission is granted to use this code, with or
* without modification, in any website or application
* provided that credit is given to the original work
* with a link back to PrayTimes.org.
*
* This program is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY.
*
* PLEASE DO NOT REMOVE THIS COPYRIGHT BLOCK.
*
*/
var libpraytimes = libpraytimes || {};
libpraytimes.ImsakSetting = function() {
var Type = {
TWILIGHT_ANGLE_BASED: 'TWILIGHT_ANGLE_BASED',
FAJR_BASED: 'FAJR_BASED',
};
var create = function(type) {
var that = {};
var getType = function() {
return type;
};
that.getType = getType;
return that;
};
var createTwilightAngleBased = function(twilightAngle) {
var that = create(Type.TWILIGHT_ANGLE_BASED);
var getTwilightAngle = function() {
return twilightAngle;
};
that.getTwilightAngle = getTwilightAngle;
return that;
};
var createFajrBased = function(minutesBeforeFajr) {
var that = create(Type.FAJR_BASED);
var getMinutesBeforeFajr = function() {
return minutesBeforeFajr;
};
that.getMinutesBeforeFajr = getMinutesBeforeFajr;
return that;
};
var DEFAULT = createFajrBased(10);
return {
Type: Type,
createTwilightAngleBased: createTwilightAngleBased,
createFajrBased: createFajrBased,
DEFAULT: DEFAULT,
};
}();