-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
68 lines (59 loc) · 2.97 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>rrule by pattern</title>
<script src="./demo/dist/es5/demo.js"></script>
</head>
<body>
<div>
<p>Let's imagine we have the following code:</p>
<form id="patternform" action="#" style="background-color: aliceblue; padding: 10px;">
<pre><code>import { RRule, RRuleSet } from 'rrule'
import { ReadableRRuleSetBuilder } from 'rrule-by-pattern'
const rruleSet = new RRuleSet()
rruleSet.rrule(new RRule({
freq: RRule.DAILY,
dtstart: new Date(Date.UTC(2026, 0, 1, 6)),
until: new Date(Date.UTC(2026, 0, 30, 6)),
}))</code></pre>
<label for="pattern"><code>const pattern: Array<0|1> = </code></label>[<input type="text" name="pattern" id="pattern" value="1,1,1,1,0,0">]
<pre><code>const builder = new ReadableRRuleSetBuilder(
rruleSet,
pattern,
rruleSet.count()
)
const newRRuleSet = builder.build()
console.log(newRRuleSet.all())</code></pre>
<input type="submit" value="Run">
</form>
</div>
<div>
<p>Console:</p>
<span id="resultmessage"></span>
<ul id="resultlist">
<li>Thu Jan 01 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Fri Jan 02 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Sat Jan 03 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Sun Jan 04 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Wed Jan 07 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Thu Jan 08 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Fri Jan 09 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Sat Jan 10 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Tue Jan 13 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Wed Jan 14 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Thu Jan 15 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Fri Jan 16 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Mon Jan 19 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Tue Jan 20 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Wed Jan 21 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Thu Jan 22 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Sun Jan 25 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Mon Jan 26 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Tue Jan 27 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
<li>Wed Jan 28 2026 07:00:00 GMT+0100 (Central European Standard Time)</li>
</ul>
</div>
</body>
</html>