Skip to content

Commit

Permalink
Fix to events calendar to display events that end at 00:00, add drop …
Browse files Browse the repository at this point in the history
…shadow to events element on mobile as suggested by @stankur
  • Loading branch information
SamuelmdLow committed Sep 21, 2024
1 parent 24348be commit fd6f95a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ async def wp_events_api_create_event(self, event_json, api, host, categorize, lo
else:
if await self.filter(title=event.title, start_time=datetime.fromisoformat(event_json['start']).astimezone(timezone.get_current_timezone())).exclude(id=event.id).aexists():
event.hidden = True
elif 'chancentre.com' in event_json['link']:
event.host = 'Chan Centre for the Performing Arts'
elif not '.ubc.ca' in event_json['link']:
event.host = host

Expand Down
6 changes: 3 additions & 3 deletions ubyssey/static_src/src/js/components/Events/calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,12 @@ function EventsCalendar({events}) {
var cur = new Date(event.start_time);
cur.setHours(0,0,0,0);
event.displayTime = displayTime(event.start_time);
if (event.end_time.getTime() - event.start_time.getTime() >= d-h) {
if (event.end_time.getTime() - event.start_time.getTime() >= d-h || event.end_time.getTime() == event.start_time.getTime()) {
event.displayTime = "";
}
while(cur < new Date(event.end_time)) {
while(cur <= new Date(event.end_time)) {
const delta = Math.floor((cur.getTime() - start.getTime()) / d);
if (delta > 0 && delta < (7*4)) {
if (delta >= 0 && delta < (7*4)) {
calendar[Math.floor(delta/7)]['days'][delta % 7]['events'].push(event);
}
cur = new Date(cur.getTime() + d);
Expand Down
3 changes: 3 additions & 0 deletions ubyssey/static_src/src/styles/components/events/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,9 @@ header.events{
}
div.day {
padding: 1.5em;
ul {
filter: drop-shadow(0 1px 3px black);
}
li {
margin-right: 2em;
b {
Expand Down

0 comments on commit fd6f95a

Please sign in to comment.