Use dayjs instead of moment. We might want to explore some other alternatives in the future.
This commit closes#4800, #4811 and #4812
PopulationSearchForm is still waiting for @joonas-a
- Reworked `populationstatistics/courses`
- `/coursesbytag` and `coursesbystudentnumberlist` now use the same API
- Updated frontend to use `/courses` instead
- Updated cypress to call the new `v4/populationstatistics/courses` instead of `v2`
- Added types to request queries, request- and response bodies for multiple `populationstatistics/` routes
- Simplified parts of `optimizedStatisticsOf` call and its callers
- Cleaned up `bottlenecksOf`
- Made `studentNumbersWithAllElements` more verbose
- Simplified `CourseStatsCounter`
- Moved functions that were only used for course statistics from `utils` to `courseStatsCounter`
- Moved `populationCourseStatMerger` into the only function it is ever called from
- Made `hasFullAccessToStudentData` explicit boolean return value
- Added `safeJSONParse` function to server utils to stop server from throwing (still needs to be implemented more widely)
- Added `formatToArray` and made `Array.isArray?val:[val]` disappear
- Made `CurriculumPicker` easier to read and more type safe
- Forced `formattedQueryParams` to be passed into `fetchPopulations` to avoid duplicate processing