This repository has been archived by the owner on Nov 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
59 lines (53 loc) · 2.29 KB
/
main.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
function getWednesdays(d) {
var date = new Date(d.getTime());
var month = date.getMonth(),
wednesdays = [];
date.setDate(1);
while (date.getDay() !== 3) {
date.setDate(date.getDate() + 1);
}
while (date.getMonth() === month) {
wednesdays.push(new Date(date.getTime()));
date.setDate(date.getDate() + 7);
}
return wednesdays;
}
var d = new Date();
var wednesdays = getWednesdays(d);
if (wednesdays[1] < d) {
d.setMonth(d.getMonth() + 1);
d.setDate(1);
wednesdays = getWednesdays(d);
}
var nextDateEl = document.getElementById("next-date");
var secondWednesday = wednesdays[2];
nextDateEl.innerText = formatDate(secondWednesday);
function formatDate(date) {
var monthNames = [
"January", "February", "March",
"April", "May", "June", "July",
"August", "September", "October",
"November", "December"
];
var day = date.getDate();
var monthIndex = date.getMonth();
var year = date.getFullYear();
return monthNames[monthIndex] + " " + day + " " + year;
}
var bowAndArrow = [35.1048139, -106.6509943];
var bAInfo = "<b>Bow and Arrow Brewing Co.</b><br> 608 McKnight Ave NW,<br> Albuquerque, NM 87102"
var meetingLocation = bowAndArrow;
var meetingLocationInfo = bAInfo;
var abqCenter = [35.0844,106.6504]
var mymap = L.map('map').setView(meetingLocation, 16);
L.tileLayer('https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/{z}/{x}/{y}?access_token=ppk.eyJ1IjoicnVzc2JpZ2dzIiwiYSI6ImNrdGFhazRqdTFrM2kydm5yYnVnNTRncmoifQ.JnbD-9CDk7zHMyD2R-E0yQ', {
maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
id: 'mapbox.streets'
}).addTo(mymap);
/*
L.marker(meetingLocation)
.addTo(mymap)
.bindPopup(meetingLocationInfo);
*/