diff --git a/public/admin.js b/public/admin.js index 4f9394a..6497503 100644 --- a/public/admin.js +++ b/public/admin.js @@ -174,7 +174,7 @@ async function setRecordSettings() { document.getElementById('require-join').addEventListener('change', async e => { const requireJoin = e.target.checked ? 1 : 0; - await PUT(`/businesses${getBusinessId()}/settings/requirejoin?new=${requireJoin}`); + await PUT(`/businesses/${getBusinessId()}/settings/requirejoin?new=${requireJoin}`); }); function validateEventTime(startDate, endDate, startTime, endTime, isRepeating = false) { @@ -217,8 +217,8 @@ document.getElementById('submitevent').addEventListener('click', () => { const starttime = document.getElementById('starttime').value; const enddate = document.getElementById('enddate').value; const endtime = document.getElementById('endtime').value; - const starttimestamp = new Date(startdate + 'T' + starttime).getTime() / 1000; - const endtimestamp = new Date(enddate + 'T' + endtime).getTime() / 1000; + const starttimestamp = new Date(startdate + 'T' + starttime).getTime(); + const endtimestamp = new Date(enddate + 'T' + endtime).getTime(); const isRepeating = document.getElementById('repeat').checked; const allTags = document.getElementById('all-tags'); @@ -242,7 +242,7 @@ document.getElementById('submitevent').addEventListener('click', () => { if (isRepeating) { const frequency = document.getElementById('frequency').value.toLowerCase(); const interval = document.getElementById('interval').value; - const timezoneOffsetMS = new Date().getTimezoneOffset() * 60 * 1000; + const timezoneOffsetMS = new Date().getTimezoneOffset() * 60_000; let daysoftheweek = []; let counter = 0; if (interval < 1) { @@ -322,8 +322,8 @@ function getEventData() { GET(`/businesses/${getBusinessId()}/events/${getEventId()}`).then(res => res.json().then(eventinfo => { tagHTMLString(eventinfo.tag); - var startDate = new Date(eventinfo.starttimestamp * 1000); - var endDate = new Date(eventinfo.endtimestamp * 1000); + var startDate = new Date(+eventinfo.starttimestamp); + var endDate = new Date(+eventinfo.endtimestamp); document.getElementById('eventdetails').innerHTML = /* html */ `
-

ⓘ  ${ +

ⓘ  ${ tips[randomTip] }

diff --git a/public/components/Table.js b/public/components/Table.js index 816e963..2d6feaf 100644 --- a/public/components/Table.js +++ b/public/components/Table.js @@ -164,8 +164,8 @@ export class Table extends Component { } // Event headers for (let i = 0; i < events.length; i++) { - var startDate = new Date(events[i].starttimestamp * 1000); - var endDate = new Date(events[i].endtimestamp * 1000); + var startDate = new Date(+events[i].starttimestamp); + var endDate = new Date(+events[i].endtimestamp); let eventName = events[i].name || '[Unnamed]'; html += `