Skip to content

Database content fixes#61

Open
samuel-skean wants to merge 4 commits into
kaytwo:mainfrom
samuel-skean:database-content-fixes
Open

Database content fixes#61
samuel-skean wants to merge 4 commits into
kaytwo:mainfrom
samuel-skean:database-content-fixes

Conversation

@samuel-skean

Copy link
Copy Markdown
Contributor

Small clarification to databases section.

not to nearest time after now.

Pros:
+ Matches expectations + button label better
+ Lets students review more easily in-class by jumping to the current
  lecture while in class, not the event that *begins* next
+ more readable date comparisons
  + No more unsightly `+new Date(/* ommitted code */)`
  + In fact, no more raw javascript `Date`

Con:
- `dayjs` gets shipped client-side
I find this logic kinda questionable, but it makes some sense.
Basically it is:
If any of the rows (that represent events) found when parsing the list
of events on a press of the "Jump to Date Button" have a null
"data-date" attribute, pretend that event is happening today.

My previous commit changed this logic subtly such that it didn't make
any sense - checking if the result of `dayjs` was null, instead of if
the attribute was null, in 2 of 3 cases - and forgetting to check at all
in the 3rd case (whoops).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant