forked from commonpike/add-to-calendar-buttons
-
Notifications
You must be signed in to change notification settings - Fork 2
/
example.html
72 lines (56 loc) · 2.92 KB
/
example.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
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<script src="add-to-calendar.js"></script>
<style>
html, body {
font-family:sans-serif;
}
</style>
<title>OUICal2 Add to Calendar Example</title>
</head>
<body>
<h1>OUICal2 Add to Calendar</h1>
<p>
This example creates a calendar from javascript data. Check the source to see how that's done.
<br><br>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<div class="new-cal"></div>
</p>
<script>
// create a calendar by hand
var myCalendar = addToCalendar({
options: {
class: 'my-class',
id: 'my-id' // If you don't pass an id, one will be generated for you.
},
data: {
title: 'Get on the front page of HN', // Event title
start: new Date('June 15, 2013 19:00'), // Event start date
// timezone: America/Los_Angeles, // converts the time to the IANA timezone
end: new Date('June 15, 2013 23:00'), // If an end time is set, this will take precedence over duration
// duration: 120, // Event duration (IN MINUTES)
// allday: true, // Override end time, duration and timezone, triggers 'all day'
address: 'The internet',
description: 'Get on the front page of HN, then prepare for world domination.'
}
});
document.querySelector('.new-cal').appendChild(myCalendar);
</script>
<p>
This example creates a calendar from html content. Check the source to see how that's done.
<br><br>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<div title="Add to Calendar" class="add-to-calendar">
<span class="start">12/18/2018 08:00 AM</span>
<span class="timezone">America/Los_Angeles</span>
<!--span class="end">12/18/2018 10:00 AM</span-->
<!--span class="duration">60</span-->
<!--span class="allday">true</span-->
<span class="title">Summary of the event</span>
<span class="description">Description of the event</span>
<span class="location">Location of the event</span>
</div>
</p>
</body>
</html>