[OLD] Add end date and time to events. #434
Closed
snedadah
wants to merge 14 commits from
events-end-time
into main
pull from: events-end-time
merge into: www:main
www:main
www:internship-guide-2
www:nextcloud-widget
www:exec-blurb
www:renovate/typescript-5.x
www:renovate/next-14.x
www:renovate/ical-generator-7.x
www:renovate/date-fns-3.x
www:renovate/typescript-eslint-parser-7.x
www:renovate/typescript-eslint-eslint-plugin-7.x
www:renovate/next-mdx-14.x
www:renovate/mdx-js-react-3.x
www:renovate/mdx-js-loader-3.x
www:renovate/node-18.x
www:Ev-New-Event-Csc-Circles-Easter-Egg-Hunt-March-27-2024-1711581834781
www:Ev-New-Event-Taxes-101-March-27-2024-1711581616630
www:Ev-New-Event-Csc-Circles-Movie-Night-March-27-2024-1711581333300
www:Ev-New-Event-Csc-Codeylympics-Ii-March-27-2024-1711581176020
www:Ev-New-Event-Csc-Trivia-Night-March-27-2024-1711580949130
www:Ev-New-Event-Info-Session-For-Ura-Grad-Opportunities-March-27-2024-1711580809155
www:Ev-New-Event-Internship-Insights-March-27-2024-1711580694779
www:Ev-New-Event-Jason-Goodison-Talk-March-27-2024-1711580404155
www:Ev-New-Event-Test-Event-March-27-2024-1711580239047
www:exec-blurbs
www:internship-guide
www:Ev-New-Event-Valentines-Code-Party-February-11-2024-1707695692668
www:Ev-New-Event-Csc-Codeylympics-February-11-2024-1707695587472
www:Ev-New-Event-Fall-2023-Elections-February-11-2024-1707695274434
www:Ev-New-Event-Csc-End-Of-Term-February-11-2024-1707694525395
www:Ev-New-Event-Csc-Dodgeball-Tournament-February-11-2024-1707694725304
www:Ev-New-Event-November-Code-Party-February-11-2024-1707681589953
www:Ev-New-Event-Trivia-Night-February-08-2024-1707443541421
www:Ev-New-Event-Escape-Mc-Manor-February-08-2024-1707443356540
www:Ev-New-Event-Recruiters-Panel-February-11-2024-1707682002638
www:Ev-New-Event-W24-Bootcamp-February-04-2024-1707084574336
www:Ev-New-Event-David-Wolever-Postgresql-Talk-February-04-2024-1707084327590
www:Ev-New-Event-Csc-Beginning-Of-Term-February-04-2024-1707083704858
www:Ev-New-Event-Csc-Beginning-Of-Term-February-04-2024-1707076757770
www:Ev-New-Event-Escape-Mc-Manor-February-01-2024-1706839752816
www:Ev-New-Event-Csc-Beginning-Of-Term-February-01-2024-1706830083872
www:update-team-page
www:Ev-New-Event-Csc-Beginning-Of-Term-January-22-2024-1705976938370
www:n4chung/update-online-membership-note
www:richard/update-exec-640
www:Ev-New-Event-Build-Networks-In-Tech-November-15-2023-1700094289813
www:Ev-New-Event-Build-Networks-In-Tech-November-15-2023-1700093575650
www:Ev-New-Event-Acing-The-Technical-Interview-W-Icpc-Coach-Christian-Lim-November-15-2023-1700090655704
www:fix-adding-class-profile-to-team-page
www:Ev-New-Event-A-November-06-2023-1699317492840
www:Ev-New-Event-A-November-06-2023-1699317323665
www:Ev-New-Event-A-November-06-2023-1699317144162
www:Ev-New-Event-A-November-06-2023-1699298328549
www:daniel-su/add-myself-to-website
www:renovate/node-21.x
www:Ev-New-Event-A-November-06-2023-1699296715918
www:Ev-New-Event-A-November-06-2023-1699296856594
www:Ev-New-Event-A-November-06-2023-1699297090365
www:Ev-New-Event-Test-November-06-2023-1699295917474
www:Ev-New-Event-Test-November-06-2023-1699296519244
www:renovate/remark-html-16.x
www:renovate/ldapts-7.x
www:renovate/npm-10.x
www:renovate/remark-15.x
www:add-s23-events
www:renovate/eslint-config-prettier-9.x
www:amy-remove-caffeine
www:anniesun/add-office-status
www:renovate/eslint-plugin-prettier-5.x
www:renovate/typescript-eslint-parser-5.x
www:renovate/prettier-3.x
www:renovate/postcss-preset-env-9.x
www:Ev-New-Event-Test-Event-June-17-2023-1687022992622
www:Ev-New-Event-Test-June-10-2023-1686447073380
www:Ev-New-Event-123-June-10-2023-1686446983999
www:Ev-New-Event-123-June-10-2023-1686446849710
www:Ev-New-Event-123-June-10-2023-1686446643513
www:Ev-New-Event-Test-June-10-2023-1686446470699
www:Ev-New-Event-Test-June-10-2023-1686437048471
www:Ev-New-Event-Test-Event-June-10-2023-1686436739371
www:Ev-New-Event-Test-Event-From-Eventr-June-10-2023-1686435846281
www:Ev-New-Event-Test-June-10-2023-1686435577325
www:shahanneda/add-tropical-code-party
www:add-imane-photo
www:Ev-New-Event-123-June-07-2023-1686113292428
www:Ev-New-Event-123-June-07-2023-1686113019308
www:meet-the-team
www:meet-team
www:meet_the_team
www:raymo-s23-updates
www:change_AVP_treasurer
www:jan-2023-constitution-changes
www:renovate/node-20.x
www:renovate/postcss-calc-9.x
www:renovate/react-dom-18.x
www:renovate/react-18.x
www:renovate/fs-extra-11.x
www:renovate/date-fns-tz-2.x
www:renovate/typescript-4.x
www:renovate/next-11.x
www:renovate/squoosh-lib-0.x
www:renovate/next-mdx-remote-3.x
www:renovate/next-mdx-11.x
www:April-Code-Party
www:add-name-to-web-committe
www:shahanneda/alt-tab-and-cp
www:darren/fix-dead-link
www:darren/add-class-profile-news
www:richardshuai/karaoke
www:shahanneda/update-team
www:w23-update-team
www:anniesun/update-blurbs
www:shahanneda/add-code-party-23
www:annies/add-circles-event
www:darren/add-news
www:anniesun/add-myself-to-webstite
www:darren/add-myself-to-website
www:shahanneda/add-myself
www:shahanneda/fix-name-parts
www:shahanneda/add-bot
www:update-events
www:shahanneda/add-events
www:shahanneda/fix-build-image-script
www:amy-add-alt-tab-f22
www:shahanneda/add-alt-tab-news
www:amy-events-karaoke
www:amy-update-annie-headshot-f22
www:amy-update-internship-repo-f22
www:amy-fix-vp-f22
www:amy-add-librarian-f22
www:shahanneda/update-exec-blurbs
www:shahanneda/add-code-party-1
www:shahanneda/update-project-program
www:a258wang-events-2022-09-28
www:amy-news-2022-09-14
www:news-2022-09-10
www:j285he-add-news-09-07
www:news-2022-09-08
www:amy-events-august-2022
www:amy-update-community-reps
www:shahanneda/add-event
www:2022-07-08-MUA-Update
www:amy-image-optimization-quick-fix-experiment
www:b72zhou-past-exec
www:shahanneda/optimze-image-script
www:neil-members
www:unix101-1
www:warning-header
www:ldap-exec-test
www:support-multiple-news-homepage
www:j285he-ldap-test-example
www:renovate/typescript-eslint-eslint-plugin-5.x
www:renovate/eslint-plugin-react-7.x
www:renovate/eslint-plugin-prettier-4.x
www:renovate/eslint-8.x
www:shahanneda-news-11jan2022
www:bonnie-team-member-card
www:fix-oc-burger
www:amy-random-shapes
Labels
No Label
a11y
Backlog
Blocked
Bug
Content
Dependencies
Design
Feature Request
Good First Issue
In Progress
Performance
Priority - High
Priority - Low
Priority - Medium
Untriaged
Milestone
Clear milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
Clear assignees
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.
No due date set.
Dependencies
No dependencies set.
Reference: www/www-new#434
Reference in New Issue
No description provided.
Delete Branch "events-end-time"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
NOTE: This PR was moved to #446 inorder to provide a cleaner git commit history.
Added an end date and time to events.
Usage:
Add an (optional) "endDate" property to an event's markdown file in order to add an end date to that events.
Staging:
https://csclub.uwaterloo.ca/~a3thakra/csc/events-end-time/
Note:
Multiday events are extremly rare and won't happen very often in all likelyhood.
Note2:
"added test events" commit will be reverted before merging the branch, it is primarly there so we can view the events in the staging.
@ -11,6 +11,7 @@ interface EventCardProps {
name: string;
short: string;
date: Date;
endDate?: Date;
naming nit: I would either
date
tostartDate
, ordate
tostart
andendDate
toend
same comment but everywhere ^
The reasoning behind not doing this was to maintain backwards compatibility with the years of previous events.
Since the endDate is optional, I think in this case it makes sense that the start date is just called date, since many times we woulnd't put endDate, and if we do, I think "date" implying its the date, or the start of the event is clear.
I personally would prefer to rename
date
tostartDate
, just for clarity and consistency. Can we update old events with a straightforward find-and-replace, ie. search for the regex^date:
incontent/events
?Ok, I'll switch it over to startDate and update the old files.
@ -30,2 +77,4 @@
{dateDisplay}
{separator}
{location}
{separator}
This separator is extra afaik
@ -19,3 +20,4 @@
minute: "numeric",
timeZoneName: "short",
});
time = time.substring(0, time.length - 3); // remove the time zone tag (eg PDT) from the start date
Could we accomplish the same thing using
const time = props.date.toLocalTimeString(...).slice(0, -3)
and thereby avoid this reassignment? I personally feel like React encourages a functional programming paradigm, and I feel that doing everything all at once is a little cleaner, but ultimately let's use whatever we think is most readable.Also, a NIT: perhaps we should rename
time
tostartTime
, for clarity?@ -23,1 +39,4 @@
const separator = <span className={styles.separator}> | </span>;
let dateDisplay;
if (!endDate) {
This is an interesting way of handling different event durations! A couple of ideas/suggestions:
endDate
):startDate | startTime | location
startDate - endDate | location
const dateDisplay = ...
instead oflet dateDisplay;
.So to confirm, do you suggest that the internal endDate (which would only be the ending time) would not be displayed anywhere on the site for single day events, and instead only in the description provided in the markdown file?
Yep, I personally think having the ending time for single-day events only in the event description is okay. My reasoning:
endDate
in the code (even if it's not programmatically being displayed on the website) is that the events.ics calendar will display the event as the correct duration.endDate
specified, as it might look a bit odd if for some events we display7:00 PM
and for others we display7:00 PM - 9:00 PM
. (Though, another way to achieve visual consistency would be to set a defaultendDate
ofstartDate + 1 hour
.)I with the points you raise, I ended up implementing it this way in #446.
6e2e5a7998
to8e38007573
Add end date and time to events.to [OLD] Add end date and time to events.Pull request closed