Skip to content

Commit

Permalink
add space when visual essay has sticky nav, hide seminars in event li…
Browse files Browse the repository at this point in the history
…nk in event homepage block, fix api request on chromium (toLocaleDateString is different between chromium and all other browsers for some unholy reason)
  • Loading branch information
SamuelmdLow committed Aug 27, 2024
1 parent 4489929 commit 0d9bf0f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion home/templates/home/stream_blocks/links.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h3>Upcoming</h3>
{% for event in events %}
{% if not forloop.counter0 == 0 %}
<li>
<a href="/events/?event={{event.event_url}}" title="{{event.title}}">
<a href="/events/?event={{event.event_url}}&hidden=seminar" title="{{event.title}}">
<b>{{event.display_time}}</b> {{event.title}}
</a>
</li>
Expand Down
17 changes: 16 additions & 1 deletion ubyssey/static_src/src/js/components/Events/calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ import {
import ReactDOM from 'react-dom';
import axios from "axios";

function getDateString(date) {
var str = String(date.getFullYear()) + "-";
if (String(date.getMonth()+1).length < 2) {
str = str + "0" + String(date.getMonth()+1) + "-";
} else {
str = str + String(date.getMonth()+1) + "-";
}
if (String(date.getDay()).length < 2) {
str = str + "0" + String(date.getDay());
} else {
str = str + String(date.getDay());
}
return str;
}

export function QueryEventsCalendar() {
const [events, setEvents] = React.useState([]);
function getEvents(){
Expand All @@ -25,7 +40,7 @@ export function QueryEventsCalendar() {
}
let end = new Date(start.getTime() + 29*d)

let q = ["end_time__gte=" + start.toLocaleDateString(),"start_time__lte=" + end.toLocaleDateString(),"limit=300"];
let q = ["end_time__gte=" + getDateString(start),"start_time__lte=" + getDateString(end),"limit=300"];
axios
.get(
'/api/events/?' + q.join("&")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,8 @@
overflow: clip;
}
}
}

.fw-story .vs-side-by-side .o-visual-essay__left-div {
padding-top: 54px;
}

0 comments on commit 0d9bf0f

Please sign in to comment.