icssc / AntAlmanac

A course exploration and scheduling tool for UCI Anteaters
https://antalmanac.com
MIT License
56 stars 70 forks source link

fix: date formatting logic in enrollmentHistory for Safari #987

Closed pinapelz closed 4 months ago

pinapelz commented 4 months ago

Summary

Safari handles parsing dates differently than other browsers. Here is one way of fixing it by handling the date as a string before making it a Date object

I think you can also maybe using something like date-fns to handle the cross platform behavior for parsing dates (although I personally think that might be too overkill for just this one use case)

Test Plan

Verified that the result is the same as what's on prod. Tested on Mac and iOS image

Issues

Closes #947

pinapelz commented 4 months ago

I've applied the changes. There was a naming conflict with date so I renamed the date data taken from enrollmentHistory to dateString instead.